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); } } }
public void Remove(ShoppingListModel eventObj) { ShoppingListList.Remove(eventObj); }
public void AddListToCollection(ShoppingListModel shoppingListObj) { ShoppingListList.Add(shoppingListObj); }