How to avoid activation of a certain page after suspension or termination?

May 14, 2015 at 10:06 AM
Edited May 14, 2015 at 10:07 AM
I do want to ensure that in case an app is navigated to a certain page, the app starts on another (in my case the previous) page after it was suspended or terminated. In my case the page is for taking photos. I do not want the user to return to this page after the app was in the background since it has no context information. The context information is on the previuos page.

But even the Microsoft Guidelines for app suspend and resume state "When resuming after a long period of time, return users to your app's default landing page.".

How could I achieve that?

I found a working solution for a resume but do not know how to solve the problem that MvvmAppBase restores the navigation state after a termination and sets the last active page for the root frame.

Here is my solution for resume (in the Resuming event of the app):
private void OnResuming(object sender, object o)
   // Check if the current root frame contains the page we do not want to 
   // be activated after a resume
   var rootFrame = Window.Current.Content as Frame;
   if (rootFrame != null && rootFrame.CurrentSourcePageType == 
      typeof (NotToBeResumedOnPage))
      // In case the page we do not want to be activated after a resume would 
      // be activated: Go back to the previous page (or optionally to another page)