WP8 back button go two steps back

限于喜欢 提交于 2020-01-05 18:40:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!