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.

 

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...