public void AddEmptyShoppingList() { var sl = new ShoppingListModel(); shoppingListsModel.AddShoppingList(sl); ShoppingLists.Add(new ShoppingListViewModel(sl)); }
private void LoadData() { ShoppingLists.Clear(); shoppingListsModel.LoadShoppingLists(); foreach (var slm in shoppingListsModel.ShoppingLists) { ShoppingLists.Add(new ShoppingListViewModel(slm)); } }
public override Task Initialize() { ShoppingLists.Add(new ListItem { Title = "Test" }); AddCmd = new MvxCommand(() => { Debug.WriteLine("Click"); }); return(base.Initialize()); }
private async Task ExecuteLoadShoppingListsCommand() { IsBusy = true; try { ShoppingLists.Clear(); System.Collections.Generic.IEnumerable <ShoppingList> items = await ShoppingListDataStore.GetShoppingListsAsync(); foreach (ShoppingList item in items) { ShoppingLists.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
/// <summary> /// Adds a new <c>ShoppingList</c>-Object to the <c>ShoppingLists</c>-Collection. /// </summary> /// <param name="shoppingList">The <c>ShoppingList</c>-Object that should added to the <c>ShoppingLists</c>-Collection.</param> public void AddShoppingList(ShoppingList shoppingList) { ShoppingLists.Add(shoppingList); SaveShoppingLists(); }
public void AddShoppingList(ShoppingListModel shoppingListModel) { ShoppingLists.Add(shoppingListModel); //Save(shoppingListModel); }