Esempio n. 1
0
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            TicTacToeSaveInfo thisSave = cons !.Resolve <TicTacToeSaveInfo>(); //usually needs this part for multiplayer games.

            TicTacToeGraphicsCP tempBoard = cons.Resolve <TicTacToeGraphicsCP>();

            tempBoard.SpaceSize = 250;
            GamePackageViewModelBinder.ManuelElements.Clear();
            _board.CreateControls(thisSave.GameBoard);
            //hopefully no update needed.
            return(this.RefreshBindingsAsync(_aggregator));
        }
Esempio n. 2
0
        public SpaceXF(SpaceInfoCP space)
        {
            ThisDraw.PaintSurface += DrawPaint;
            _gameBoard1            = Resolve <TicTacToeGraphicsCP>();
            this.SetName(nameof(TicTacToeMainViewModel.MakeMoveAsync));
            CommandParameter = space;
            GamePackageViewModelBinder.ManuelElements.Add(this); //hopefully this simple.
            EventAggregator thisE = Resolve <EventAggregator>();

            BindingContext = space;
            WidthRequest   = _gameBoard1.SpaceSize;
            HeightRequest  = _gameBoard1.SpaceSize;
            thisE.Subscribe(this, EnumRepaintCategories.FromSkiasharpboard.ToString());
        }
Esempio n. 3
0
        public SpaceWPF(SpaceInfoCP space)
        {
            _thisDraw = new SKElement();
            _thisDraw.PaintSurface += DrawPaint;
            Name             = nameof(TicTacToeMainViewModel.MakeMoveAsync);
            CommandParameter = space;
            //_thisMod = Resolve<TicTacToeViewModel>();
            _gameBoard1 = Resolve <TicTacToeGraphicsCP>();
            EventAggregator thisE = Resolve <EventAggregator>();

            DataContext = space;
            Width       = _gameBoard1.SpaceSize;
            Height      = _gameBoard1.SpaceSize;
            thisE.Subscribe(this, EnumRepaintCategories.FromSkiasharpboard.ToString());
            GamePackageViewModelBinder.ManuelElements.Add(this); //hopefully this simple.
            //MouseUp += SpaceWPF_MouseUp;
            Content = _thisDraw;
        }