private async Task ExecuteLoadShoppingItemsCommand()
        {
            IsBusy = true;

            try
            {
                ShoppingItems.Clear();
                System.Collections.Generic.IEnumerable <ShoppingItem> items;
                if (selectedMode == Mode.Modify)
                {
                    items = await ShoppingListDataStore.GetShoppingItemsAsync(shoppingListId);
                }
                else
                {
                    items = await ShoppingListDataStore.GetShoppingItemsOrderBySortKeyAsync(shoppingListId);
                }
                foreach (ShoppingItem item in items)
                {
                    ShoppingItems.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        private async void OnShoppingListRemove(ShoppingList shoppingList)
        {
            if (shoppingList != null)
            {
                await ShoppingListDataStore.RemoveShoppingListAsync(shoppingList);

                IsBusy = true;
            }
        }
        private void LoadStoreItems()
        {
            StoreItems.Clear();
            IEnumerable <StoreItem> items = ShoppingListDataStore.GetStoreItemsAsync().Result;

            foreach (StoreItem item in items)
            {
                StoreItems.Add(item);
            }
        }
        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;
            }
        }
Esempio n. 5
0
 private async void DeleteDatabase()
 {
     await ShoppingListDataStore.ResetDatabaseAsync();
 }
Esempio n. 6
0
 private async void RecalculateItemSort()
 {
     await ShoppingListDataStore.RecalculateStoreItemSort();
 }