private void MainNavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args) { var invokedItem = (string)args.InvokedItem; Type pageType = null; if (invokedItem == "Todo List") { pageType = typeof(RemoteListPage); } else if (invokedItem == "Calendar") { pageType = typeof(CalendarMonthPage); } if (pageType is null) { return; } ContentFrame.NavigateToType(pageType, _remote, new FrameNavigationOptions { TransitionInfoOverride = args.RecommendedNavigationTransitionInfo, IsNavigationStackEnabled = false }); }
private void Navigate(Type sourcePageType) { if (ContentFrame.CurrentSourcePageType() != sourcePageType) { ContentFrame.NavigateToType(sourcePageType); } }
private void Navigate(object item) { if (item is NavigationViewItem menuItem) { Type pageType = GetPageType(menuItem); if (ContentFrame.CurrentSourcePageType() != pageType) { ContentFrame.NavigateToType(pageType); } } }
public static void NavigateTo(string pageName, object parameter = null) { Type pageType = Type.GetType($"TmdbMovies.Views.{pageName}"); if (pageType == null) { throw new ArgumentException("Unknown page requested"); } ContentFrame?.NavigateToType(pageType, parameter, null); }
private void DebuggingScenario_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args) { FrameNavigationOptions navOptions = new FrameNavigationOptions(); navOptions.TransitionInfoOverride = args.RecommendedNavigationTransitionInfo; var itemContainer = sender.SelectedItem; Type pageType; if (itemContainer == FirstException) { pageType = typeof(FirstExceptionPage); } else if (itemContainer == SecondException) { pageType = typeof(SecondExceptionPage); } else if (itemContainer == ThirdException) { pageType = typeof(ThirdExceptionPage); } else if (itemContainer == SlownessPattern) { pageType = typeof(SlownessPatternPage); } else if (itemContainer == HighCPU) { pageType = typeof(HighCPUPage); } else if (itemContainer == HotReload) { pageType = typeof(HotReloadPage); } else if (itemContainer == HighMemroy) { pageType = typeof(HighMemoryPage); } else if (itemContainer == OOPBackgroundtask) { pageType = typeof(OOPBackgroundtaskPage); } else if (itemContainer == PlayAudioGraph) { pageType = typeof(FileAudioGraph); } else if (itemContainer == UWPPackages) { pageType = typeof(UWPPackagesPage); } else if (itemContainer == AlarmToast) { pageType = typeof(AlarmToast); } else if (itemContainer == WevViewOne) { pageType = typeof(webviewone); } else { pageType = typeof(MainPage); } ContentFrame.NavigateToType(pageType, null, navOptions); }
public static void NavigateTo(Type pageType, object parameter = null) { ContentFrame?.NavigateToType(pageType, parameter, null); }
public PageTransitionPage() { InitializeComponent(); ContentFrame.NavigateToType(typeof(SamplePages.SamplePage1)); }
private void NavigateForward(object sender, RoutedEventArgs e) { var pageToNavigateTo = ContentFrame.BackStackDepth() % 2 == 1 ? typeof(SamplePages.SamplePage1) : typeof(SamplePages.SamplePage2); ContentFrame.NavigateToType(pageToNavigateTo); }