private async void ExecuteRemoveItemCommand(Models.TodoItem param) { await _todoItemRepository.DeleteTodoItem(this.TodoItem); this.TodoItem = null; // Navigate back ((App)App.Current).NavigationService.GoBack(); }
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; } }