Suspending event not raising using WinRT

Suspending event won’t fire while you are debugging (but while running your App normal, it will fire just after you navigate away from the App) as it is said also at this blog:

…you will wait forever for these to trigger, even though your app switches back and forth to the screen! The reason is simple: while an app is being debugged, Windows will not suspend it.

Note that this may lead to some weird app behavior, when there is something wrong in Suspending event – for example if you pass some complex class in Frame.Navigate method and you use SuspensionManager. While debugging your app will work just fine (no suspension), but will crash without debug mode.

To test how your App behaves, you will have to invoke the Suspending manuallt, open (or set visible) Debug location toolbar in Visual Studio, there you will find a dropdown Lifecyce events, choose there Suspend, and then to return the App – Resume.

enter image description here

Leave a Comment