예제 #1
0
        private async void ExecuteRemoveItemCommand(Models.TodoItem param)
        {
            await _todoItemRepository.DeleteTodoItem(this.TodoItem);

            this.TodoItem = null;

            // Navigate back
            ((App)App.Current).NavigationService.GoBack();
        }
예제 #2
0
        private async void ExecuteRemoveItemCommand(Models.TodoItem param)
        {
            try
            {
                var index = this.ItemVMs.IndexOf(this.SelectedItem);

                await _todoItemRepository.DeleteTodoItem(this.SelectedItem.TodoItem);

                this.ItemVMs.Remove(this.SelectedItem);
                this.SelectedItem = this.ItemVMs[index];
            }
            catch { this.SelectedItem = null; }
        }