1
votes

I am using from codeplex Tombstone Helper (Tombstone Helper) and am having problems fast switching between apps.

I've included the "two line code" method and am testing my app in the emulator.

I've activated the tombstoning option for debugging. all my controls have names; i then press the 'home' button and when i go back to my app i still see the "Resuming" loading message. I have in my App.xaml.cs a bool to see if my app was dormant or tombstoned :

WasTombstoned = !e.IsApplicationInstancePreserved;

and in my xaml view page i have :

   protected override void OnNavigatedTo(NavigationEventArgs e)       

    {            
if(App.WasTombstoned == true)         
         this.RestoreState();

    }

    protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) 
  {   
   this.SaveState(e);    
    }

What am i doing wrong?

2
Maybe a silly question, but have you set the project to build against version 7.1?calum
@calum I don't think IsApplicationInstancePreserved would've let him compile against 7.0William Melani
@willmel good point - I think I must have had a caffeine deficiency when I posted that :)calum

2 Answers

0
votes

The "Resuming..." message is displayed by the OS while restoring an application which has been tombstoned. If you configure your project to show this while debugging this is expected.

If you see the phone (or emulator) seemingly hang indefinitely on this message during debugging then that's due to the process the debugger having been unloaded from memory. If you press F5 or equivalent in VisualStudio this will resume the process where you were and you can continue debugging.

Or is your question really something else?
Do you still see the same behaviour if you comment out the call to RestoreState()?

0
votes

There's a checkbox in the application properties Debug tab which tells the emulator whether to tombstone or not when debugging so that you can easily test your tombstoning code. This is probably currently set to tombstone. A bit more detail on the subject:

http://windowsphonerocks.com/Developer/DeveloperArticles/tabid/64/Article/163/how-to-enable-windows-phone-application-tombstone-in-emulator-when-debugging.aspx