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; } }
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; } }
public void AddTodoList(TodoList todoList) { TodoLists.Add(todoList); SaveChanges(); }