Search code examples
windows-phone-7exitshutdown

Close a WP7 application programmatically?


Possible Duplicate:
Windows Phone 7 close application

How do I programmatically close a WP7 application?


Solution

  • You can always call an exit by doing this at your landing page use this code on click of your application back button:

    if (NavigationService.CanGoBack)
    {
        while (NavigationService.RemoveBackEntry() != null)
        {
            NavigationService.RemoveBackEntry();
        }
    }
    

    This will remove back entries from the stack, and you will press a back button it will close the application without any exception.