You mentioned not to use StartupMode to detect a tombstone, how should it be done?
If you just want to detect if a tombstone happened, simply set a flag in your App’s handler to Deactivated event.
If the value of the flag has not been reset (in Activated event) , then the app was not terminated.
If the value of the flag has been reset (in Activated event) then app was terminated.
public partial class App : Application
bool wasApplicationTerminated = true ;
private void Application_Deactivated(object sender, DeactivatedEventArgs e)
wasApplicationTerminated = false;
private void Application_Activated(object sender, ActivatedEventArgs e)
if ( wasApplicationTerminated== true )
// real tombstone, new App instance
// must have been a chooser that did not tombstone or a quick back.
All that said, the above check is not always useful; you most often will want to know more than whether app was tombstoned; you want to know if it was tombstoned since your pages were NavigatedFrom .. Stay tuned for that tomorrow..