Example #1
0
        private async void ExecuteLoadCommand()
        {
            try
            {
                Busy = true;
                await Task.Delay(2000);

                var data = _todoListRepository.Sample(10).Select(x => new ViewModels.TodoListViewModel(x));
                TodoLists.Clear();
                foreach (var item in data.OrderBy(x => x.TodoList.Title))
                {
                    TodoLists.Add(item);
                }
            }
            finally { Busy = false; }
        }
Example #2
0
        async Task ExecuteLoadTodoListsCommand()
        {
            IsBusy = true;

            try
            {
                TodoLists.Clear();
                var todoLists = await DataStore.GetTodoListsAsync(true);

                foreach (var todoList in todoLists)
                {
                    TodoLists.Add(todoList);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #3
0
 public void AddTodoList(TodoList todoList)
 {
     TodoLists.Add(todoList);
     SaveChanges();
 }