Beispiel #1
0
        public GameControls(GameFieldViewModel gameFieldViewModel, Color backgroundColor, Action UpdateGameField)
        {
            this.UpdateGameField = UpdateGameField;
            ViewModel            = new GameControlsViewModel(gameFieldViewModel, StartTurn, FinishTurn);

            BackgroundColor = backgroundColor;

            MakeGameControl();
            CanvasView[0].PaintSurface += (sender, args) => OnCanvasViewPaintSurface(sender, args, 0);
            CanvasView[1].PaintSurface += (sender, args) => OnCanvasViewPaintSurface(sender, args, 1);

            CanvasView[0].InvalidateSurface();
            CanvasView[1].InvalidateSurface();
        }
Beispiel #2
0
 /// <summary>
 /// Инициализация моделей представления
 /// </summary>
 internal GameWindowViewModel()
 {
     this.GameControlsViewModel = new GameControlsViewModel();
     this.GameBoardViewModel    = new GameBoardViewModel(this.GameControlsViewModel);
 }