问题描述
我想弄清楚如何在 Windows Phone 8 sdk 中返回两页.我知道我可以覆盖该函数:
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...
大家有什么建议吗?
推荐答案
查看 这篇文章.它详细描述了如何使用 BackStack
属性和 RemoveBackEntry
方法来操作导航历史记录.您需要通过删除最后一个条目来更新 Back Stack.删除最后一个条目将允许您向后导航两页.
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);
}
这篇关于WP8 后退按钮后退两步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!