问题
Lets assume I have two pages MainPage and DetailsPage. In details page user hits on start button then hits on the back button to get to the Previous Page. And If we don't have tombstone coding they will have blank page.
Is it possible to resume the application from the MainPage (not the detailspage) when they hit back button.
Kind regards.
回答1:
I'm not sure if this is possible via a built-in code path, but you can detect when the phone is activating from tombstone using the PhoneApplicationService.Activated
event. When this occurs, you could manually navigate the phone to your main page either directly or via programmatic back button presses.
I would argue against all of that though. Your app should serialize the data to isolated storage and restore it properly. This is the expected behaviour users will want to see inside WP7 apps in my opinion.
http://www.imaginativeuniversal.com/blog/post/2010/08/22/WP7-Tombstoning-Pattern-Tip.aspx
Update: from Claus in the comments below. You can also utilise the query string on the URL. This is automatically persisted when the app is tombstoned. This query string can be used to trigger the loading of data again, to save you from serializing the entire set. In your case it looks as though you are fetching data from the web, so the query string will work well for you.
However, you need to weigh that against adding pressure to the user's phone data plan. If serializing the set is a cheap action, I'd say go that route.
来源:https://stackoverflow.com/questions/6731228/wp7-resume-from-the-page-i-assigned