コード例 #1
0
        private async Task ChangeStatus(ToDoItemViewModel vm)
        {
            vm.Status = ToDoStatus.Completed;
            var item = await App.Repository.Get(vm.Id);

            item.Status = ToDoStatus.Completed;
            App.Repository.Update(item);
            await App.Repository.SaveAsync();
        }
コード例 #2
0
        private async Task DeleteToDo(ToDoItemViewModel viewModel)
        {
            var result = await UserDialogs.Instance.ConfirmAsync(
                Constants.DeleteToDoQuestion,
                Constants.Warning,
                Constants.Ok,
                Constants.Cancel);

            if (result)
            {
                ToDoItems.Remove(viewModel);
                await App.Repository.DeleteAsync(viewModel.Id);

                await App.Repository.SaveAsync();
            }
        }