相当于"OnBackKeyPress"是什么意思? [英] What is the equivalent to "OnBackKeyPress"
问题描述
在Windows Phone 8.0中,我使用它来处理后退按钮:
In Windows Phone 8.0 I used this to handle the back button:
protected override void OnBackKeyPress(CancelEventArgs e)
{
base.OnBackKeyPress(e);
}
此事件在页面"控件上不存在.如何处理WP 8.1中的后退按钮?
This Event does not exists on the "Page" control. How can I handle a click on the back button in WP 8.1?
推荐答案
If you add a Basic Page to your project then VS will add a NavigationHelper class to your project which helps with Navigating thru your App, you can also see in the source code that it is subscribing to Windows.Phone.UI.Input.HardwareButtons.BackPressed
.
如果您想扩展处理后退"按钮(管理事件处理程序队列等),可以此答案-那里的方法将有助于防止向后导航(如果不需要)并添加更多行为.
In case you want to extend handling the Back Button (managing Eventhandler queue and so on) you may take a look at this answer - the method there will help to prevent backward navigation (if you don't need it) and add some more behaviours.
这篇关于相当于"OnBackKeyPress"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!