Beispiel #1
0
        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);
        }