private void AddPlayerViewModel(IPlayer player) { var playerListViewModel = new PlayerListViewModel(player); this.PlayerListViewModels.Add(playerListViewModel); playerListViewModel.PropertyChanged += PlayerListViewModel_PropertyChanged; this.SelectedPlayer = playerListViewModel; }
private void DeleteSelectedPlayer() { if (this.SelectedPlayer != null) { this.PlayerListViewModels.Remove(this.selectedPlayerViewModel); this.SelectedPlayer = null; // should notify that player is deleted (since player maybe currently part of a game) } }