Beispiel #1
0
        public async void LoadShoppingListAsync()
        {
            PersistancyService.FileCreation();
            ObservableCollection <ShoppingListModel> shopLists = await PersistancyService.LoadShopListFromJsonAsync();

            ShoppingListSingleton.Instance.ShoppingListList.Clear();
            if (shopLists == null)
            {
                ShoppingListList.Add(new ShoppingListModel("FiskeFars", ViewModel.ViewModel.Category[0]));
                PersistancyService.SaveShopListAsJsonAsync(ShoppingListList);
            }
            else
            {
                foreach (var shopList in shopLists)
                {
                    ShoppingListList.Add(shopList);
                }
            }
        }
Beispiel #2
0
 public void AddListToCollection(ShoppingListModel shoppingListObj)
 {
     ShoppingListList.Add(shoppingListObj);
 }