7

When i set ActivationPolicy="Resume" in WMAppManifest.xml page tile navigation(navigation URL) is not working in Tombstone state, it reloads the last back stack page(URL). It works fine with Dormant state with out reloading the page. If don't set this property (ActivationPolicy="Resume") it reloads the page in both states [Dormant state and Tombstone state].

But how can we achieve the navigation to secondary url's, when we set that property.

Please help me .

1
  • I don't follow you explanation of the issue you're seeing. Can you elaborate with a minimal and working code repro? Jan 16, 2013 at 7:04

2 Answers 2

23

Adding ActivationPolicy="Resume" is not the only step needed to have your app support Fast App Resume. I believe the behavior you are describing is normal when you only set that one property. I think there are a few ways to implement "Fast App Resume", but I found this to be the easiest way.

Set the activation policy like you just described and then do the following:

Go into App.xaml.cs in the "App" class add:

   private bool reset

You should then have a method for InitializePhoneApplication that initializes the RootFrame. Add this:

RootFrame.Navigating += RootFrame_Navigating;
RootFrame.Navigated += RootFrame_Navigated;

Then you can go and add those methods:

void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e)
{
    if (reset && e.IsCancelable && e.Uri.OriginalString == "/MainPage.xaml")
    {
        e.Cancel = true;
        reset = false;
    }
}

void RootFrame_Navigated(object sender, NavigationEventArgs e)
{
    reset = e.NavigationMode == NavigationMode.Reset;
}

If you implement this properly, your app should resume from the last page you were on.

1
  • Good stuff. This works great for me. I would add that if you have a deeper back stack than the main page and one child then I figure you are going to have to cancel more then one navigation (the first one, the page you were on has isCancelable==true, but for the others they are isCancelable==false). Just cancel them all then set rest to false when you are back to where it tries to navigate to MainPage.xaml
    – David
    Jul 25, 2013 at 6:08
2

Same problem here. I got WP8 application with Fast App Resume enabled. I can pin tiles pointing to specific pages in my apps. It works fine when app is just Suspended, but when the app is Tombstoned, then clicking secondary tile has the same effect as clicking the main tile.

I receive only one RootFrameNavigating event with NavigationMode == Back and Uri == /MainPage.xaml. The app then shows the previous page that was there before I suspended the app.

I guess this is actual bug in the platform for this specific scenario - Fast App Resume + tombstoned app + navigation from pinned tile, that we as developers cannot solve.

1
  • 1
    Retargeting a Silverlight app to Silverlight 8.1 fixes the problem with deep links and tombstoned apps :-)
    – japf
    Jun 1, 2014 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.