简体   繁体   中英

Windows phone 8.1 back button always navigate to main screen

I have lots of pages in my app . When I click back button it does not navigate to previous page but it navigate to the lock screen where all apps are present . Should I have to write code for back button for navigation??

是的,您需要覆盖电话的OnBackKeyPress来处理后退按钮应导航到的位置。

AddHandler HardwareButtons.BackPressed, AddressOf HardwareButtons_BackPressed

Private Sub HardwareButtons_BackPressed(sender As Object, e As BackPressedEventArgs)
    e.Handled = True
    YourGoBackCode()
End Sub

And same in c#

HardwareButtons.BackPressed += HardwareButtons_BackPressed;

private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
{
   e.Handled = true;
   YourGoBackCode();
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM