Exemple #1
0
        public PokerMainViewModel(IEventAggregator aggregator,
                                  CommandContainer commandContainer,
                                  IGamePackageResolver resolver
                                  )
        {
            GlobalClass.PokerList.Clear(); //can't be brand new  that could cause the connection to break too.
            _aggregator      = aggregator; //this time no new game.  just close out when you are done now.
            Round            = 1;
            CommandContainer = commandContainer;
            CommandContainer.ExecutingChanged += CommandContainer_ExecutingChanged; //hopefully no problem (?)
            DeckPile = resolver.ReplaceObject <DeckObservablePile <PokerCardInfo> >();
            DeckPile.DeckClickedAsync += DeckPile_DeckClickedAsync;
            DeckPile.NeverAutoDisable  = true;
            DeckPile.SendEnableProcesses(this, () =>
            {
                return(!IsRoundOver);
            });

            Bet1 = new NumberPicker(commandContainer, resolver);
            Bet1.SendEnableProcesses(this, () =>
            {
                return(!BetPlaced);
            });
            Bet1.LoadNumberList(new CustomBasicList <int>()
            {
                5, 10, 25
            });
            Bet1.SelectNumberValue(5); //something else has to set to large (?)
            Bet1.ChangedNumberValueAsync += Bet1_ChangedNumberValueAsync;

            _mainGame = resolver.ReplaceObject <PokerMainGameClass>(); //hopefully this works.  means you have to really rethink.
        }