您的位置:首页 > 其它

Windows10 UWP Back Button的处理

2015-12-10 14:34 204 查看
1,Making the Back button appear requires just one line of code:

SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;


2,Responding to clicks of the Back button is a simple matter of wiring up a handler for SystemNavigationManager.BackRequested events:

SystemNavigationManager.GetForCurrentView().BackRequested += (s, e) =>
{
// TODO: Go back to the previous page
};


3,手机端back的事件处理:

if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
BackButton.Visibility = Visibility.Collapsed;
Windows.Phone.UI.Input.HardwareButtons.BackPressed += OnHardwareBackButtonPressed;
}


附: http://www.wintellect.com/devcenter/jprosise/handling-the-back-button-in-windows-10-uwp-apps

  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: