Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            MastermindMainViewModel model = (MastermindMainViewModel)DataContext;

            _colors.LoadLists(model.Color1);
            return(this.RefreshBindingsAsync(_aggregator));
        }
Exemple #2
0
        public ChooseSuitView(CrazyEightsVMData model)
        {
            EnumPickerWPF <DeckPieceCP, DeckPieceWPF, EnumSuitList> picker = new EnumPickerWPF <DeckPieceCP, DeckPieceWPF, EnumSuitList>();

            picker.GraphicsHeight = 200;
            picker.GraphicsWidth  = 200;
            picker.LoadLists(model.SuitChooser);
            Content = picker;
        }
        public ChooseColorView(IEventAggregator aggregator, UnoVMData model)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            StackPanel stack = new StackPanel();
            EnumPickerWPF <CheckerChoiceCP <EnumColorTypes>,
                           CheckerChooserWPF <EnumColorTypes>, EnumColorTypes> picker = new EnumPickerWPF <CheckerChoiceCP <EnumColorTypes>, CheckerChooserWPF <EnumColorTypes>, EnumColorTypes>();

            stack.Children.Add(picker);
            picker.GraphicsHeight = 300;
            picker.GraphicsWidth  = 300;
            BaseHandWPF <UnoCardInformation, UnoGraphicsCP, CardGraphicsWPF> hand = new BaseHandWPF <UnoCardInformation, UnoGraphicsCP, CardGraphicsWPF>();

            stack.Children.Add(hand);
            hand.Margin = new Thickness(5);
            hand.LoadList(model.PlayerHand1, ts.TagUsed);
            picker.LoadLists(model.ColorPicker);
            Content = stack;
        }
        public RageColorView(RageCardGameVMData model, RageCardGameGameContainer gameContainer)
        {
            StackPanel stack = new StackPanel();
            BaseHandWPF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF> hand = new BaseHandWPF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF>();
            ScoreBoardWPF score = new ScoreBoardWPF();

            RageCardGameMainView.PopulateScores(score);
            SimpleLabelGrid details = new SimpleLabelGrid();

            details.AddRow("Trump", nameof(RageColorViewModel.TrumpSuit));
            details.AddRow("Lead", nameof(RageColorViewModel.Lead));
            EnumPickerWPF <CheckerChoiceCP <EnumColor>, CheckerChooserWPF <EnumColor>, EnumColor> piece = new EnumPickerWPF <CheckerChoiceCP <EnumColor>, CheckerChooserWPF <EnumColor>, EnumColor>();

            stack.Children.Add(piece);
            stack.Children.Add(hand);
            stack.Children.Add(details.GetContent);
            stack.Children.Add(score);
            Content = stack;
            score !.LoadLists(gameContainer.SaveRoot.PlayerList);
            hand !.LoadList(model.PlayerHand1 !, "");
            piece.LoadLists(model.Color1);
        }
Exemple #5
0
        public ChooseGenderView(IEventAggregator aggregator, LifeBoardGameVMData model, LifeBoardGameGameContainer gameContainer)
        {
            _aggregator    = aggregator;
            _gameContainer = gameContainer;
            _aggregator.Subscribe(this);
            StackPanel stack  = new StackPanel();
            var        picker = new EnumPickerWPF <CirclePieceCP <EnumGender>, CirclePieceWPF <EnumGender>, EnumGender>();

            stack.Children.Add(picker);
            picker.LoadLists(model.GenderChooser);
            _car           = new CarPieceWPF();
            _car.Height    = 186;
            _car.Width     = 102;
            _car.Margin    = new Thickness(0, 20, 0, 0);
            _car.MainColor = _gameContainer.SingleInfo !.Color.ToColor(); //because too late the first time it runs.
            _car.Init();
            stack.Children.Add(_car);
            SimpleLabelGrid simple = new SimpleLabelGrid();

            simple.AddRow("Turn", nameof(ChooseGenderViewModel.Turn));
            simple.AddRow("Instructions", nameof(ChooseGenderViewModel.Instructions));
            stack.Children.Add(simple.GetContent);
            Content = stack;
        }
Exemple #6
0
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            _color.LoadLists(_model.ColorChooser);

            return(Task.CompletedTask);
        }