示例#1
0
        private void Dispatcher_AcceleratorKeyActivated(CoreDispatcher sender, AcceleratorKeyEventArgs args)
        {
            if (args.KeyStatus.IsMenuKeyDown)
            {
                switch (args.VirtualKey)
                {
                case VirtualKey.Left:
                    NavigationActions.Back_Click(null, null);
                    break;

                case VirtualKey.Right:
                    NavigationActions.Forward_Click(null, null);
                    break;

                case VirtualKey.F:
                    App.OccupiedInstance.RibbonArea.RibbonTabView.SelectedIndex = 0;
                    break;

                case VirtualKey.H:
                    App.OccupiedInstance.RibbonArea.RibbonTabView.SelectedIndex = 1;
                    break;

                case VirtualKey.S:
                    App.OccupiedInstance.RibbonArea.RibbonTabView.SelectedIndex = 2;
                    break;

                case VirtualKey.V:
                    App.OccupiedInstance.RibbonArea.RibbonTabView.SelectedIndex = 3;
                    break;
                }
            }
        }
示例#2
0
 private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
 {
     if (args.CurrentPoint.Properties.IsXButton1Pressed)
     {
         NavigationActions.Back_Click(null, null);
     }
     else if (args.CurrentPoint.Properties.IsXButton2Pressed)
     {
         NavigationActions.Forward_Click(null, null);
     }
 }
示例#3
0
 private void Window_BackRequested(object sender, BackRequestedEventArgs e)
 {
     if (App.CurrentInstance.ContentFrame.CanGoBack)
     {
         e.Handled = true;
         NavigationActions.Back_Click(null, null);
     }
     else
     {
         e.Handled = false;
     }
 }
示例#4
0
        private void SwipeablePage_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if (e.IsInertial && !_isSwiped)
            {
                var swipedDistance = e.Cumulative.Translation.X;

                if (Math.Abs(swipedDistance) <= 2)
                {
                    return;
                }

                if (swipedDistance > 0)
                {
                    NavigationActions.Back_Click(null, null);
                }
                else
                {
                    NavigationActions.Forward_Click(null, null);
                }
                _isSwiped = true;
            }
        }