这是Windows Phone 8.1的新增功能。
如果使用VS2013模板创建新的Hub Universal App,则会在Common文件夹中看到一个名为NavigationHelper的类。
此NavigationHelper提示您如何正确响应后退按钮。因此,如果您不想使用NavigationHelper,请按照以下方法恢复原来的行为:
public BlankPage1(){ this.InitializeComponent(); HardwareButtons.BackPressed += HardwareButtons_BackPressed;}void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e){ if (frame.CanGoBack) { e.Handled = true; frame.GoBack(); }}您也可以在应用程序级别上执行此操作,以避免在每个页面上都执行此操作:
public App(){ this.InitializeComponent(); this.Suspending += this.OnSuspending; #if WINDOWS_PHONE_APP HardwareButtons.BackPressed += HardwareButtons_BackPressed; #endif}#if WINDOWS_PHONE_APPvoid HardwareButtons_BackPressed(object sender, BackPressedEventArgs e){ frame rootframe = Window.Current.Content as frame; if (rootframe != null && rootframe.CanGoBack) { e.Handled = true; rootframe.GoBack(); }}#endif


