Created
January 9, 2016 19:02
-
-
Save wtuts/e9c3665b075e64b1eeb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public App() | |
{ | |
this.InitializeComponent(); | |
this.Suspending += this.OnSuspending; | |
HardwareButtons.BackPressed += HardwareButtons_BackPressed; | |
} | |
private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e) | |
{ | |
var rootFrame = Window.Current.Content as Frame; | |
if (rootFrame != null && rootFrame.CanGoBack) | |
{ | |
e.Handled = true; | |
rootFrame.GoBack(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment