I\'m trying to save my model in isolated storage:
var settings = IsolatedStorageSettings.ApplicationSettings;
CurrentPlaceNowModel model = new CurrentPlaceNowMo
I've just noticed what you've done wrong:
if (model == null)
{
MessageBox.Show("NULL");
settings.Add("model", model);
}
That's going to be equivalent to calling settings.Add("model", null)
- so how would you expect to get a non-null value out later? I suspect you want:
CurrentPlaceNowModel model;
if (!settings.TryGetValue("model", out model))
{
model = new CurrentPlaceNowModel();
settings.Add("model", model);
}