예제 #1
0
        /// <summary>
        /// 菜单栏点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            var mySender = sender as MenuItem;

            switch (mySender.Name)
            {
            case "MenuItemAbout":
                GlobalTool.OpenDialogButton
                    (this,
                    "Flower\nAnimal Crossing : New Horizons\n"
                    + Application.ResourceAssembly.GetName().Version.ToString()
                    + "\n\n作者 FunJoo\n开源 https://gitee.com/funjoo/ACNHFlower/ "
                    );
                break;

            case "MenuItemExit":
                GlobalTool.CloseApp();
                break;

            case "MenuItemZajiao":
                FrameMain.Navigate(new PageZajiao());
                break;

            case "MenuItemParent":
                FrameMain.Navigate(new PageParent());
                break;
            }
        }
예제 #2
0
        /// <summary>
        /// 标题栏按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TitlebarButton_Click(object sender, RoutedEventArgs e)
        {
            var mySender = sender as Button;

            switch (mySender.Name)
            {
            case "ButtonTitlebarMin":
            {
                this.WindowState = WindowState.Minimized;
            }
            break;

            case "ButtonTitlebarMax":
            {
                if (this.ActualWidth == SystemParameters.WorkArea.Width &&
                    this.ActualHeight == SystemParameters.WorkArea.Height)
                {
                    WindowNormal();
                }
                else
                {
                    WindowMax();
                }
            }
            break;

            case "ButtonTitlebarClose":
            {
                GlobalTool.CloseApp();
            }
            break;
            }
        }