コード例 #1
0
        private void AddPlayerViewModel(IPlayer player)
        {
            var playerListViewModel = new PlayerListViewModel(player);

            this.PlayerListViewModels.Add(playerListViewModel);
            playerListViewModel.PropertyChanged += PlayerListViewModel_PropertyChanged;
            this.SelectedPlayer = playerListViewModel;
        }
コード例 #2
0
 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)
     }
 }