public async Task DeleteTodoList()
        {
            HttpResult result = await client.DeleteTodoListAsync(1);

            Assert.IsNotNull(result, "Result is null");
            Assert.IsTrue(result.Succeeded, GetRequestFailedMessage(result));
        }
        private async void TodoListTitleTextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            TextBox       todoListTitleTextBox = (TextBox)sender;
            TodoListModel todoList             = GetDataContext <TodoListModel>(sender);

            string newTitle = todoListTitleTextBox.Text;

            if (newTitle != todoList.OriginalTitle)
            {
                HttpResult result;
                using (TodoClient todoClient = ClientFactory.CreateTodoClient())
                {
                    if (String.IsNullOrWhiteSpace(newTitle))
                    {
                        result = await todoClient.DeleteTodoListAsync(todoList.TodoListId);

                        if (result.Succeeded)
                        {
                            TodoPageModel.TodoLists.Remove(todoList);
                        }
                    }
                    else
                    {
                        TodoList update = new TodoList()
                        {
                            TodoListId = todoList.TodoListId, Title = newTitle
                        };
                        result = await todoClient.UpdateTodoListAsync(update);

                        if (!result.Succeeded)
                        {
                            todoList.Title = todoList.OriginalTitle;
                        }
                    }
                }

                if (!result.Succeeded)
                {
                    await ErrorDialog.ShowErrorsAsync(result.Errors);
                }
            }
        }
        private async void DeleteAppBarButton_Click(object sender, RoutedEventArgs e)
        {
            TodoListModel todoList = GetSelectedTodoList();

            HttpResult result;

            using (TodoClient todoClient = ClientFactory.CreateTodoClient())
            {
                result = await todoClient.DeleteTodoListAsync(todoList.TodoListId);
            }

            if (result.Succeeded)
            {
                TodoPageModel.TodoLists.Remove(todoList);
            }
            else
            {
                await ErrorDialog.ShowErrorsAsync(result.Errors);
            }
        }