Close a WP7 application programmatically? [duplicate]

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.

Leave a Comment