How to terminate your Windows Phone application programmatically?

added by spavkov
8/19/2012 8:35:44 AM

0 Kicks, 49 Views

Its known that in Windows Phone API there is no easy way to terminate the current application from your code. I guess makers of the platform did not wanted us developers to mingle with the application lifetime too much, phone should decide when an app is not needed and terminate it. But i just simply cannot help myself, i always like to have full control, for example in my Offline Browser application i want to end the app if user presses the hardware Back Key multiple times in short time intervals. Because there is this annoying situation when user goes navigating between the pages in your app (main screen, then settings, then about screen, then again main screen etc) and then when he wants to terminate it he need to click the hardware back button N number of times in order to close it. And even in some other situations its needed to force close the app, for example if some change in application settings requires app restart etc.


0 comments