Exemple #1
0
        async Task ExecuteAddItemsCommand(string newcategory)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            try
            {
                if (string.IsNullOrEmpty(newcategory))
                {
                    return;
                }
                Item item = new Item
                {
                    Text        = newcategory,
                    Description = newcategory
                };
                Items.Add(item);
                ItemsOnPage.Add(item);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemple #2
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Items.Clear();
                var items = await DataStore.GetItemsAsync(true);

                foreach (var item in items)
                {
                    Items.Add(item);
                    ItemsOnPage.Add(item);
                    FlowItems.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }