예제 #1
0
        private void OnNavButtonClick(object sender, RoutedEventArgs e)
        {
            RadioButton selectedNav = sender as RadioButton;

            if (NavigationDictionary[selectedNav] != ShellFrame.CurrentSourcePageType)
            {
                ShellFrame.Navigate(NavigationDictionary[selectedNav]);
            }
        }
        public FlightReservationWindow(SearchQuery queryObject)
        {
            this.InitializeComponent();

            _queryObject = queryObject;

            ShellFrame.Navigate(typeof(FlightReservationPage), _queryObject);

            PaymentButton.Click += PaymentButton_Click;
        }
예제 #3
0
 private void ShellNavigationView_Loaded(object sender, RoutedEventArgs e)
 {
     foreach (NavigationViewItem item in NavigationItems)
     {
         ShellNavigationView.MenuItems.Add(item);
     }
     // naviagte to home page by default
     LastPage = "Home";
     ShellFrame.Navigate(typeof(Home));
     // next two lines make it so that the small colored rectangle (indicator) is shown next to the home nav item
     ShellNavigationView.SelectedItem = NavigationItems[0];
     ShellNavigationView.UpdateLayout();
 }
예제 #4
0
        private void ShellNavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
        {
            if (args.IsSettingsInvoked)
            {
                LastPage = "Settings";
                ShellFrame.Navigate(typeof(Settings));
                return; // don't do anything else
            }

            string clickedNavigationItem = args.InvokedItem.ToString();

            if (clickedNavigationItem == LastPage)
            {
                // don't navigate to page if already navigated to (duh!)
                Debug.Out("Navigation was annulled (tried going to the page already navigated to)");
                return;
            }
            else
            {
                LastPage = clickedNavigationItem;
            }

            Debug.Out("Navigating to " + clickedNavigationItem);
            switch (clickedNavigationItem)
            {
            case "Home":
                ShellFrame.Navigate(typeof(Home));
                break;

            case "Redirections":
                ShellFrame.Navigate(typeof(Redirections));
                break;

            case "Core Modules":
                ShellFrame.Navigate(typeof(CoreModules));
                break;

            default:
                Debug.Out("Unknown page \"" + clickedNavigationItem + "\" could not be navigated to", "WARNING");
                break;
            }
        }
        private void PaymentButton_Click(object sender, RoutedEventArgs e)
        {
            switch (currentStep)
            {
            case 0:
                ShellFrame.Navigate(typeof(PaymentPage));
                break;

            case 1:
                ShellFrame.Navigate(typeof(BoardingPass));
                PaymentButton.Content = "Finish";
                break;

            case 2:
                this.Close();
                break;
            }

            currentStep++;
        }
예제 #6
0
        private void HamburgerMenu_Navigate(NavigationViewItem item)
        {
            if (item.Tag.ToString().Equals(CurrentPageTag))
            {
                // ex. at Home, tried to navigate to Home again
                // System.Diagnostics.Debug.WriteLine("Tried to navigate to the current page again (given: " + item.Tag.ToString() + ", current: " + CurrentPageTag + ")");
                return;
            }

            switch (item.Tag)
            {
            case "home":
                ShellFrame.Navigate(typeof(Pages.Home));
                break;

            case "page2":
                ShellFrame.Navigate(typeof(Pages.Page2));
                break;
            }
        }