Reputation: 3537
I'm developing a little app for Windows Phone 8 that has 2 pages (1 is of course the main page).
When page2 is reached I want to check if this page has been reached by pressing the back button on the phone. I want to do something like this:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
if (backButton.isPressed()) {
// this page has been reached by pressing the back button on the phone
} else {
// this page has been reached by NavigationService.Navigate()
}
}
Is there a native API to do that?
Upvotes: 0
Views: 290
Reputation: 15006
Is this what you need?
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (e.NavigationMode == NavigationMode.Back)
{
...
}
}
Upvotes: 3