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.