首页 > Windows开发 > 详细

Windows10 UWP Back Button的处理

时间:2015-12-10 14:56:23      阅读:216      评论:0      收藏:0      [点我收藏+]

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

  

Windows10 UWP Back Button的处理

原文:http://www.cnblogs.com/wlqsmiling/p/5035971.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!