问题
I am trying to figure out how I could go two pages back in windows phone 8 sdk. I know I can overwrite the function:
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
the problem is, that I can not understand how I could go two pages back... I have an app that is like that:
Display Overview > select Booking > Confirm Booking > Booking done
When bookking is done I would like to go back to the Overview page...
Anyone some suggestions?
回答1:
Check out this article. It describes in detail how to use the BackStack
property and the RemoveBackEntry
method to manipulate the navigation history. You'll want to update the Back Stack, by removing the last entry. Removing the last entry will allow you to navigate back two pages.
You could use something like this:
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
RootFrame.RemoveBackEntry();
base.OnBackKeyPress(e);
}
来源:https://stackoverflow.com/questions/16524500/wp8-back-button-go-two-steps-back