I've got a big code base we just migrated to phone and are beginning to deal with tombstoning and deactivation. In the meantime I'd like to stop the app on Application_Deactivated so that it will call Application_Launching rather than Application_Activated when reactivating from tombstone. Anyone know of a way to accomplish this?
Asked
Active
Viewed 110 times
1 Answers
1
As far as i know, you should not intervene in the application cycle and let OS handle things. I read that you should not use the following functionality. It is not advised to use it. Though, this is a way ::
Application.Current.Terminate();
Add this line to your Application_Deactivated
handler. This will terminate and kill your application. But then you won't find your app in the background. You will have to launch it freshly the next time you want to use it.
If this is not what you want, and you wish exactly to restart the application on bringing it to foreground, then i don't see any direct way to do that. Thanks and cheers.

Gaurav Deochakke
- 2,265
- 2
- 21
- 26
-
This will likely be the course I take until a full restore pass has been made - the reason I hesitate is that it will also prevent fast resume from working which makes the 'restart from tombstone' palatable. – jchristof May 29 '14 at 13:26
-
Exactly. Right. That will prevent fast resume. There is no option of "putting in the background" for the approach which i have suggested here. And moreover, i am unsure whether microsoft allows this way of terminating an application going in background. Thanks and cheers. Do vote up or accept if it helped. – Gaurav Deochakke May 29 '14 at 16:05