private async Task DeleteAsync() { if (SelectedGame == null) { return; } await gameManager.DeleteGame(SelectedGame.Id); Clear(); }
public async Task DeleteSelectedGames() { if (SelectedGames.Count == 0) { return; } if (MessageBox.Show(string.Format("Delete {0} games?", SelectedGames.Count), "Delete games?", MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes) { return; } var selectedGames = SelectedGames.ToList(); foreach (var game in selectedGames) { await gameManager.DeleteGame(game.Id); } }