Exemple #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;
        }
Exemple #2
0
 void HBNext_Click(object sender, RoutedEventArgs e)
 {
     if (ContentFrame.CanGoForward)
     {
         ContentFrame.GoForward();
     }
 }
        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
        }
Exemple #4
0
 private void forwardbtn_Click(object sender, RoutedEventArgs e)
 {
     if (ContentFrame.CanGoForward)
     {
         ContentFrame.GoForward();
     }
 }
 private bool On_ForwardRequested()
 {
     if (!ContentFrame.CanGoForward)
     {
         return(false);
     }
     ContentFrame.GoForward();
     return(true);
 }
Exemple #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();
        }
Exemple #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();
            }
        }
Exemple #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();
                }
            }
        }
Exemple #9
0
 public void GoForward()
 {
     ContentFrame.GoForward();
 }