I\'m writing a windows phone 7 app. I have \"fatal exception\" handling code where I know for sure that the app is totally busted and there\'s no point in continuing. (I\'
When you are trying to programatically quit a WP7 application, you need keep in mind the application certification requirements. Peter Torr has a blog post that can help with your approach. Paul Jenkins experienced issues with the MahTweets app in the Marketplace recently and he blogged about it here.
HTH, indyfromoz
For Windows Phone 8, simply call App.Current.Terminate();
I suppose you can let your app throw an unhandled exception at which point, Windows Phone will automatically terminate your application.
As for certification requirement, you can ask for exception. This method has always worked for me.
App.Current.MainWindow.Close()
App.Current.Terminate();
For Windows Phone 8.1 Silverlight Apps
Navigate to App.xaml.cs
in your solution explorer and
add a static method to the App
class
public static void Exit()
{
App.Current.Terminate();
}
so that you can call it anywhere from your application , as below
App.Exit();