Unlike PCs, all Windows Phone devices have a Back button that allows users to navigate backwards between the pages of the app. If the user presses the back button again when they go to the first page of the app, the operating system suspends your app and navigates the user to the app's pre-launch experience. The experience might be another app, or it might be the start screen. This topic discusses how your app should handle backpressed events to provide a consistent user experience.
Handling backpressed Events
The most thing to know about the backpressed event that is raised when the user presses the back button is: If your app is not set by setting the backpressedeventargs.handled property to True To handle the event, the operating system suspends your app and brings the user back to the previous experience. So, in an event handler, if your app can navigate backwards, you need to do this, and then set the backpressedeventargs.handled property to true. If your app is on the first page and cannot navigate backwards, you should not handle the event, and the operating system will suspend your app. Fortunately, the logic for this situation is provided by default in the Windows Phone app's template. The following code is provided in the App.xaml.cs file.
Private void Hardwarebuttons_backpressed (object sender, Backpressedeventargs e) { as Frame; ifnull) { return; } if (frame. CanGoBack) { frame. GoBack (); true ; }}
Turn from:
Https://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/dn639128.aspx
Working with the Back button (XAML) in a Windows Phone app