[UWP]后退按键不在Windows Phone 10中触发 [英] [UWP]Back Key press is not trigger in windows phone 10
问题描述
我用prism框架创建了通用Windows应用程序。我有5页,其中2页将调用4页。但是当我按下第2页上的键(硬件密钥窗口)时,它应该转到第3页。它在平板电脑上工作正常。但不是在Windows Phone 10中。
i have created Universal Windows app with prism framework. I have 5 pages in which 2 page will call 4 page. But when i press back key on page 2 (HardWare key windows) it should go to page 3. It is working fine in tablet. But not in windows Phone 10.
用xaml.cs编写的代码:
Code written in xaml.cs :
OnNavigate我有注册BackRequest
OnNavigate i have register BackRequest
" SystemNavigationManager.GetForCurrentView()。BackRequested + = Manage_BackRequest; " &
"SystemNavigationManager.GetForCurrentView().BackRequested += Manage_BackRequest;" &
注册OnNavigationFrom
de register OnNavigationFrom
" SystemNavigationManager.GetForCurrentView()。BackRequested - = Manage_BackRequest; "
"SystemNavigationManager.GetForCurrentView().BackRequested -= Manage_BackRequest;"
在平板电脑中,当按下后退键时,按 Manage_BackRequest 方法触发&他们我正在浏览各自的页面。但在Windows Phone 10中,事件不是触发器&它导航后页。
In tablet when back key is press Manage_BackRequest method is trigger & their i am navigating to respective page. But in Windows Phone 10 the event is not trigger & it navigates the back page.
他们是否需要处理Windows Phone 10中的反键按键事件。
Is their any other action required to handle backkey press event in Windows Phone 10.
请帮忙解决问题。
推荐答案
您好,
我无法在Windows 10 Mobile - 1511和1607版本上重现您的问题。你能提供更多信息吗?但是随时代码将始终有效。
I can not reproduce your issue on both Windows 10 Mobile - 1511 and 1607 versions. Can you provide more information? But anytime following code will always work.
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
但是您应该为您的项目添加移动扩展程序
but you should add Mobile extensions to your project
这篇关于[UWP]后退按键不在Windows Phone 10中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!