Remove a page from Navigation Stack

前端 未结 6 1434
暖寄归人
暖寄归人 2021-01-11 11:05

I have this application schema :

[List Page] -> [Detail Page] -> [ShareOnFacebook Page]
                     ^__________________|
    <
6条回答
  •  星月不相逢
    2021-01-11 11:23

    I use the removeBackEntry method on the NavigationService Class. I also use this as a way to setup my own splash screens

            private void BWorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            // switch screen 
            NavigationService.Navigated += new NavigatedEventHandler(NavigationServiceNavigated);
            NavigationService.Navigate(new Uri("/Pages/main.xaml", UriKind.Relative));
    
        }
    
        void NavigationServiceNavigated(object sender, NavigationEventArgs e)
        {
            NavigationService.RemoveBackEntry();
        }
    

提交回复
热议问题