public static void SaveAll(ShoppingListViewModel model) { using (var store = IsolatedStorageFile.GetUserStoreForApplication()) { Save <ShoppingListViewModel>(store, "current_list.lst", model); } }
public static ShoppingListViewModel CreateOrLoadFromStorage() { ShoppingListViewModel model = new ShoppingListViewModel(); try { using (var store = IsolatedStorageFile.GetUserStoreForApplication()) { if (store.FileExists("current_list.lst")) { model = model.Load <ShoppingListViewModel>(store, "current_list.lst"); } } } catch { } return(model); }