1
votes

When my WP7 app comes back from being Tombstoned, it creates the ViewModelLocator class that I have stored in App.Resources. How do are you suppose to handle this? In my ViewModelLocator constructor there are several ViewModels being created and in those constructors there are several WCF Service calls. It seems wrong to let this class be recreated every time it comes back from being tombstoned.

It seems like I need to serialize the ViewModelLocator before my app gets Tombstoned, and deserialize it after. Sound correct??? and is there something in MVVM-Light to handle this?

1

1 Answers

1
votes

You definitely need to save your data to be able to restore it after tombstoning.

MVVM Light provides the MVVM framework for you, not the WP7 data storage solution. You'll need to implement this yourself using whatever storage format is most suitable for you and Isolated Storage.

Here's a basic examples that uses IsolatedStorageSettings... a dictionary based abstraction provided by the WP7 SDK.

Tombstoning on the Win7 Mobile Platform