Exemple #1
0
        protected override void OnKeyDown(KeyRoutedEventArgs e)
        {
            base.OnKeyDown(e);
            if (e.Handled)
            {
                return;
            }

            switch (e.Key)
            {
            case VirtualKey.Control:
                _isCtrlPressed = true;
                break;

            case VirtualKey.P:
                if (_isCtrlPressed)
                {
                    e.Handled = true;
                    var action = GraphPrinter.PrintAsync(Graph);
                }
                break;

            case VirtualKey.N:
                if (_isCtrlPressed)
                {
                    e.Handled = true;
                    NewFunction();
                }
                break;

            case VirtualKey.F11:
            {
                ApplicationView view = ApplicationView.GetForCurrentView();
                if (view.IsFullScreenMode)
                {
                    view.ExitFullScreenMode();
                    e.Handled = true;
                }
                else
                {
                    e.Handled = view.TryEnterFullScreenMode();
                }
            }
            break;

#if PERF_TEST
            case VirtualKey.F5:
                PerfTest();
                break;
#endif
            }
        }
Exemple #2
0
 private async void PrintButton_ClickAsync(object sender, RoutedEventArgs e)
 => await GraphPrinter.PrintAsync(Graph).ConfigureAwait(false);