예제 #1
0
        private async Task DeleteAsync()
        {
            if (SelectedGame == null)
            {
                return;
            }

            await gameManager.DeleteGame(SelectedGame.Id);

            Clear();
        }
예제 #2
0
        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);
            }
        }