0
votes

I am developing Windows phone 8.1 Silver Light Application. In the application there are so many screens. Pages are navigating perfectly.

My issue is when i press on back button(Windows Phone Back Button) The pages are going back to the previous pages. I want to stop back button navigation in my application. I followed below link but i am not succeeded. https://social.msdn.microsoft.com/Forums/windowsapps/en-us/131a99ce-53a4-4389-81e9-7801af57b78b/used-hardwarebuttonsbackpressed-handler

Could any one advise me.

1
Beware, it can be the reason to fail the certification in the store. - crea7or
Means if i add below code windows store accepts my application? - rajaramesh

1 Answers

1
votes

Try this for back button on your XAML.cs page :

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
        base.OnBackKeyPress(e);
        if (NavigationService.CanGoBack)
        {
            while (NavigationService.RemoveBackEntry() != null)
            {
                NavigationService.RemoveBackEntry();
            }
        }
 }