如何在手机处于锁定状态时使用硬件键启动 Windows 应用程序。需要硬件键事件来触发 Windows 10 或 8.1 Windows 商店应用程序中的操作。
问问题
67 次
1 回答
0
而是 Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed; 你需要使用 var systemNavigationManager = Windows.UI.Core.SystemNavigationManager.GetForCurrentView(); 其中包含BackRequested事件
您还可以添加扩展库并使用 API for Windows Phone 8.1 Store App
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
但是当设备被锁定时,您的应用程序进入挂起模式并且您无法处理事件
于 2015-07-14T08:19:55.480 回答