In practice, you can also forget these methods. You should not think of the tomb as a persisting state, but of persisting data.
You obviously cannot magically pile up the state of your entire application. And generally speaking, the state of the user interface of the page will be known only about a separate page.
What you need to do is find out which UI states you want to save, if any, and then save them along with the data (obviously) in PhoneApplicationService.State or IsolatedStorage.ApplicationSettings (depending on the size of the data).
For ViewModels, it’s pretty easy to tomb them. Just add the code to check if the gravestone exists, and then load the data using the view model at creation. And if you bind all the user interface settings to your viewing model, you will be pretty gold.
The code from your previous question can be used in your ViewModels constructor with almost the same result. And to keep the ViewModel persistent, just attach a local handler for the PropertyChanged and save the ViewModel state every time you call.
source share