コード例 #1
0
 internal TicTacToeGridViewModel(TicTacToeGridModel ticTacToeGridModel, TicTacToeControlsViewModel ticTacToeControlsViewModel)
 {
     _playerWon = false;
     _ticTacToeControlsViewModel = ticTacToeControlsViewModel;
     ConvertTicTacToeToObservableCollection(ticTacToeGridModel);
     
     MakeMoveCommand = new RelayCommand<int[]>(this.MakeMove);
 }
コード例 #2
0
 private void ConvertTicTacToeToObservableCollection(TicTacToeGridModel TicTacToeGridModel)
 {
     foreach (var items in TicTacToeGridModel.TicTacToeBoard)
     {
         ObservableCollection<ControlEnums.Player> TicTacToeRow = new ObservableCollection<ControlEnums.Player>();
         foreach (var item in items) TicTacToeRow.Add(item);
         _ticTacToeBoard.Add(TicTacToeRow);
     }
 }