1

For a windows phone 8 app I'm developing, I had to load some data at the starting of the app. For that matter I designed a page called SplashScreen.xaml that loads the data and after all the loading is done I navigate to the MainPage.xaml using:

    NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));

Now when the user is in the main page and taps the back button on the phone instead of going out of the app(which is the default gesture) goes back to the SplashScreen.xaml, making them unable to go out of the app(except for taping the start button which take's the app to background) and of course giving them a bad impression. The question is How to prevent going back to the previous page Thank you all.

4

1 回答 1

4

登陆MainPage时只需清除backstack:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    while (NavigationService.RemoveBackEntry() != null);
}
于 2013-09-28T22:08:22.533 回答