internal TicTacToeGridViewModel(TicTacToeGridModel ticTacToeGridModel, TicTacToeControlsViewModel ticTacToeControlsViewModel) { _playerWon = false; _ticTacToeControlsViewModel = ticTacToeControlsViewModel; ConvertTicTacToeToObservableCollection(ticTacToeGridModel); MakeMoveCommand = new RelayCommand<int[]>(this.MakeMove); }
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); } }