Ejemplo n.º 1
0
        public void AddEmptyShoppingList()
        {
            var sl = new ShoppingListModel();

            shoppingListsModel.AddShoppingList(sl);
            ShoppingLists.Add(new ShoppingListViewModel(sl));
        }
Ejemplo n.º 2
0
 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;
            }
        }
Ejemplo n.º 5
0
 /// <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();
 }
Ejemplo n.º 6
0
 public void AddShoppingList(ShoppingListModel shoppingListModel)
 {
     ShoppingLists.Add(shoppingListModel);
     //Save(shoppingListModel);
 }