private async Task ExecuteRefreshCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                var _items = await toDoTable.GetItemsAsync();

                ToDos.Clear();
                foreach (var item in _items)
                {
                    ToDos.Add(item);
                }

                IsBusy = false;
            }
            catch (Exception ex)
            {
                await Application.Current.MainPage.DisplayAlert("Error", ex.Message, "OK");
            }
        }
Beispiel #2
0
        private void RefreshList()
        {
            ToDos.Clear();
            var query = database.GetItems <ToDoItem>().OrderByDescending(c => c.Created);

            foreach (var item in query)
            {
                ToDos.Add(item);
            }
        }