コード例 #1
0
        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
            });
        }
コード例 #2
0
 private void Navigate(Type sourcePageType)
 {
     if (ContentFrame.CurrentSourcePageType() != sourcePageType)
     {
         ContentFrame.NavigateToType(sourcePageType);
     }
 }
コード例 #3
0
 private void Navigate(object item)
 {
     if (item is NavigationViewItem menuItem)
     {
         Type pageType = GetPageType(menuItem);
         if (ContentFrame.CurrentSourcePageType() != pageType)
         {
             ContentFrame.NavigateToType(pageType);
         }
     }
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public static void NavigateTo(Type pageType, object parameter = null)
 {
     ContentFrame?.NavigateToType(pageType, parameter, null);
 }
コード例 #7
0
        public PageTransitionPage()
        {
            InitializeComponent();

            ContentFrame.NavigateToType(typeof(SamplePages.SamplePage1));
        }
コード例 #8
0
        private void NavigateForward(object sender, RoutedEventArgs e)
        {
            var pageToNavigateTo = ContentFrame.BackStackDepth() % 2 == 1 ? typeof(SamplePages.SamplePage1) : typeof(SamplePages.SamplePage2);

            ContentFrame.NavigateToType(pageToNavigateTo);
        }