I am trying to get the back button to go back to the previous page instead of closing the app. Until now, I had no luck. Its a universal app but I'm making the windows phone 8.1 first. I have the following code but its not working!
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
this.Frame.Navigate(typeof(MainPage));
base.OnBackKeyPress(e);
}
this is the error I get:
Error 3 'Windows.UI.Xaml.Controls.Page' does not contain a definition for 'OnBackKeyPress'