Пример #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _messenger.Register <CloseDashboard>(this, _ => DashboardPopup.Hide());

            _messenger.Register <NavigatedToOperation>(this, msg =>
            {
                switch (msg.NavigationMode)
                {
                case NavigationMode.New:
                    if (msg.Operation == null)
                    {
                        ContentFrame.Navigate(typeof(ApiInfoPage), SessionManagerVM.CurrentDocument);
                    }
                    else
                    {
                        ContentFrame.Navigate(typeof(SwaggerOperationPage), msg.Operation);
                    }
                    break;

                case NavigationMode.Back: ContentFrame.GoBack(); break;

                case NavigationMode.Forward: ContentFrame.GoForward(); break;
                }

                OperationsListView.SelectedItem = msg.Operation;
            });

            KeyDown += OnKeyDown;
            SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;
        }
Пример #2
0
 void HBNext_Click(object sender, RoutedEventArgs e)
 {
     if (ContentFrame.CanGoForward)
     {
         ContentFrame.GoForward();
     }
 }
Пример #3
0
        private void Next_Button_Click(object sender, RoutedEventArgs e)
        {
            if (ContentFrame.CanGoForward)
            {
                ContentFrame.GoForward();
            }
            else
            {
                if (lastAddedPageIndex < pages.Count - 1)
                {
                    lastAddedPageIndex++;
                    ContentFrame.Navigate(pages[lastAddedPageIndex].page);
                }
                else if (currentPageIndex == pages.Count - 1)
                {
                    Close();
                    return;
                }
            }

            //Checking if back button should be enabled after updating current index
            currentPageIndex++;
            Button_Update(pages[currentPageIndex]);
            Steps_Update(pages[currentPageIndex]);

            //if (Back_Button.IsEnabled != pages[currentPageIndex].canGoBack) Back_Button.IsEnabled = !Back_Button.IsEnabled; //Quite cool, always works as it checks if enabled is equal to if it may be enabled and the other way around
        }
Пример #4
0
 private void forwardbtn_Click(object sender, RoutedEventArgs e)
 {
     if (ContentFrame.CanGoForward)
     {
         ContentFrame.GoForward();
     }
 }
Пример #5
0
 private bool On_ForwardRequested()
 {
     if (!ContentFrame.CanGoForward)
     {
         return(false);
     }
     ContentFrame.GoForward();
     return(true);
 }
Пример #6
0
        private async void Refresh_Click(object sender, RoutedEventArgs e)
        {
            GetLamps();
            Lamps = LampsProp;

            await Task.Delay(TimeSpan.FromSeconds(0.3));

            ContentFrame.GoBack();
            ContentFrame.GoForward();
        }
Пример #7
0
        private void MainPage_OnKeyDown(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == VirtualKey.Left && e.KeyStatus.IsMenuKeyDown && ContentFrame.CanGoBack)
            {
                ContentFrame.GoBack();
            }

            if (e.Key == VirtualKey.Right && e.KeyStatus.IsMenuKeyDown && this.ContentFrame.CanGoForward)
            {
                ContentFrame.GoForward();
            }
        }
Пример #8
0
        private void MainPage_OnPointerPressed(object sender, PointerRoutedEventArgs e)
        {
            if (e.Pointer.PointerDeviceType == PointerDeviceType.Mouse)
            {
                PointerPoint ptrPt = e.GetCurrentPoint(this);

                if (ptrPt.Properties.IsXButton1Pressed && ContentFrame.CanGoBack)
                {
                    ContentFrame.GoBack();
                }

                if (ptrPt.Properties.IsXButton2Pressed && ContentFrame.CanGoForward)
                {
                    ContentFrame.GoForward();
                }
            }
        }
Пример #9
0
 public void GoForward()
 {
     ContentFrame.GoForward();
 }