Exemple #1
0
        private void MainWindow_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.F11:
                WindowStyle = WindowStyle.None;
                WindowState = WindowState.Maximized;
                Topmost     = true;

                ShortcutsInfo.Text = InternalResources.ShortcutInfoExitFullScreen;
                break;

            case Key.Escape:
                WindowStyle = WindowStyle.SingleBorderWindow;
                WindowState = WindowState.Normal;
                Topmost     = false;

                ShortcutsInfo.Text = InternalResources.ShortcutInfoEnterFullScreen;
                break;

            default:
                if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.O)
                {
                    _dispatcherTimer.Stop();

                    var optionsDialog = new OptionsWindow();
                    optionsDialog.Closing += OptionsWindow_Closing;
                    optionsDialog.ShowDialog();
                }
                break;
            }
        }
        private void MainWindow_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.F11)
            {
                WindowStyle = WindowStyle.None;
                WindowState = WindowState.Maximized;
                Topmost     = true;

                ShortcutsInfo.Text = InternalResources.ShortcutInfoExitFullScreen;
            }

            if (e.Key == Key.Escape)
            {
                WindowStyle = WindowStyle.SingleBorderWindow;
                WindowState = WindowState.Normal;
                Topmost     = false;

                ShortcutsInfo.Text = InternalResources.ShortcutInfoEnterFullScreen;
            }

            if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.O)
            {
                _dispatcherTimer.Stop();

                foreach (Grid grid in UniformGridBuilds.Children.OfType <Grid>())
                {
                    grid.Background = Graphics.BrushNeutral;
                }

                OptionsWindow optionsDialog = new OptionsWindow();
                optionsDialog.Closing += OptionsWindow_Closing;
                optionsDialog.ShowDialog();
            }
        }
        private void MainWindow_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
                case Key.F11:
                    WindowStyle = WindowStyle.None;
                    WindowState = WindowState.Maximized;
                    Topmost = true;

                    ShortcutsInfo.Text = InternalResources.ShortcutInfoExitFullScreen;
                    break;
                case Key.Escape:
                    WindowStyle = WindowStyle.SingleBorderWindow;
                    WindowState = WindowState.Normal;
                    Topmost = false;

                    ShortcutsInfo.Text = InternalResources.ShortcutInfoEnterFullScreen;
                    break;
                default:
                    if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.O)
                    {
                        _dispatcherTimer.Stop();

                        var optionsDialog = new OptionsWindow();
                        optionsDialog.Closing += OptionsWindow_Closing;
                        optionsDialog.ShowDialog();
                    }
                    break;
            }
        }