我试图让后退按钮返回上一页而不是关闭应用程序。直到现在,我都没有运气。它是一个通用应用程序,但我首先制作的是 windows phone 8.1。我有以下代码,但它不起作用!
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
this.Frame.Navigate(typeof(MainPage));
base.OnBackKeyPress(e);
}
这是我得到的错误:
错误 3“Windows.UI.Xaml.Controls.Page”不包含“OnBackKeyPress”的定义