Prior to Windows Phone 8, the only way to programmatically exit a XAML-based app was to raise and not handle an exception. It was an inelegant hack for a not-uncommon scenario.
In Windows Phone 8, however, the API includes a direct mechanism for terminating an app. It is achieved using the
Terminate method, as demonstrated:
Terminate method only when the user is unable to make any useful forward progress. For example, if the user is presented with an End User License Agreement and declines it, the app may choose to terminate. Or if the app requires the user to log in and the user cannot provide valid credentials, the app may display a message and ...