New! GraphQL.NET Cookbook by Senthil Kumar Balu

How to Terminate the WP8 Application Programmatically using C#?

If you want to terminate your Windows Phone 8 programmatically using C#, you can do it using the below code snippet.

Application.Current.Terminate ();

How to Terminate the WP8 Application Programmatically using C#?

When using this method, one should be careful because this method cannot generally be used to provide the “exit” mechanism for the app like the back key and also that the Application.Current.Terminate method does not raise any application lifecycle events. This method will just terminate thye current process.

This might make the developers work difficult In case some code on saving of data is written in the Application Closing event.

The developer must explicitly save the state of the windows phone application before calling this method.

 

Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.