예제 #1
0
        public void LoadList(SorryCardGamePlayerItem tempPlayer, CommandContainer command)
        {
            _thisPlayer = tempPlayer;
            StackLayout thisStack = new StackLayout();

            thisStack.Orientation      = StackOrientation.Horizontal;
            _clickCommand              = tempPlayer.GetPlainCommand(command, nameof(SorryCardGamePlayerItem.SorryPlayerAsync)); //not just player anymore.
            thisStack.InputTransparent = true;
            _thisList = new CustomBasicList <CardGraphicsXF>();
            for (int x = 1; x <= 4; x++)
            {
                var thisCard = new CardGraphicsXF();
                _thisList.Add(thisCard);
                thisCard.SendSize("", new SorryCardGameCardInformation());
                thisCard.BindingContext   = null;
                thisCard.InputTransparent = true;
                thisStack.Children.Add(thisCard);
            }
            Text           = _thisPlayer.NickName;
            BindingContext = _thisPlayer;
            var thisRect = ThisFrame.GetControlArea();

            thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            var thisGrid = new Grid();

            ThisDraw.EnableTouchEvents = true;
            ThisDraw.Touch            += ThisDraw_Touch;
            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(thisStack);
            Content = thisGrid;
            _clickCommand !.CanExecuteChanged += ClickCommandChange;
            _thisPlayer.PropertyChanged       += ThisPlayerPropertyChange;
            RefreshList();
        }
예제 #2
0
        protected override void FirstSetUp()
        {
            var thisScore = new ScoringGuideClassCP();

            ThisFrame.Text = "Scoring Guide";
            Grid firstGrid = new Grid();

            firstGrid.Children.Add(ThisDraw);
            var  thisRect  = ThisFrame.GetControlArea();
            Grid otherGrid = new Grid();

            otherGrid.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 3, 3, 5);
            GridHelper.AddLeftOverColumn(otherGrid, 2);
            GridHelper.AddLeftOverColumn(otherGrid, 2);
            StackPanel thisStack = new StackPanel();

            AddLabel(thisScore.OffenseText, true, thisStack);
            GridHelper.AddControlToGrid(otherGrid, thisStack, 0, 0);
            var thisList = thisScore.OffenseList();

            thisList.ForEach(item => AddLabel(item, false, thisStack));
            thisStack = new StackPanel();
            GridHelper.AddControlToGrid(otherGrid, thisStack, 0, 1);
            thisList = thisScore.DefenseList();
            AddLabel(thisScore.DefenseText, true, thisStack);
            thisList.ForEach(item => AddLabel(item, false, thisStack));
            firstGrid.Children.Add(otherGrid);
            Content = firstGrid;
        }
예제 #3
0
        protected override void FirstSetUp()
        {
            HorizontalOptions = LayoutOptions.Start;
            VerticalOptions   = LayoutOptions.Start;
            Grid firstGrid = new Grid();

            firstGrid.Children.Add(ThisDraw);
            ScrollView thisScroll = new ScrollView();

            Text = "Score Details";
            var thisRect = ThisFrame.GetControlArea();

            thisScroll.Margin       = new Thickness(thisRect.Left, thisRect.Top, 3, 2);
            _mainGrid               = new Grid();
            _mainGrid.RowSpacing    = 0;
            _mainGrid.ColumnSpacing = 4;
            thisScroll.Orientation  = ScrollOrientation.Both;
            thisScroll.Content      = _mainGrid;
            firstGrid.Children.Add(thisScroll);
            Content = firstGrid;
            GridHelper.AddAutoRows(_mainGrid, 1);
            _rowList = new CustomBasicList <BindData>();
            AddColumn("Nick Name", true, "NickName", rightMargin: 8);
            firstGrid.HorizontalOptions = LayoutOptions.Start;
            firstGrid.VerticalOptions   = LayoutOptions.Start;
        }
예제 #4
0
        public void Init(ScoreHandCP mod)
        {
            _tempMod  = mod;
            _cardList = _tempMod.CardList;
            _cardList.CollectionChanged += CollectionChanged;
            _thisGrid = new Grid();
            Text      = _tempMod.Text; // i think
            Grid parentGrid = new Grid();

            parentGrid.Children.Add(ThisDraw);
            parentGrid.Children.Add(_thisGrid);
            var thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(_thisGrid, thisRect);
            _thisGrid.Margin = new Thickness(_thisGrid.Margin.Left, _thisGrid.Margin.Top + 8, _thisGrid.Margin.Right, _thisGrid.Margin.Bottom); // not sure why did not work well this time (?)
            AddAutoColumns(_thisGrid, 3);
            AddAutoRows(_thisGrid, 2);
            HorizontalAlignment = HorizontalAlignment.Stretch;

            Content = parentGrid;
            if (_cardList.Count > 0)
            {
                PopulateList();
            }
        }
        public ActionDoAgainView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Card List";
            StackPanel stack    = new StackPanel();
            SKRect     thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(stack, thisRect); //i think.
            ListChooserWPF list = new ListChooserWPF();

            list.LoadLists(actionContainer.CardList1 !); // i think
            ScrollViewer thisScroll = new ScrollViewer();

            thisScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            thisScroll.Content = list;
            thisScroll.Height  = 500; // well see.
            stack.Orientation  = Orientation.Horizontal;
            stack.Children.Add(thisScroll);
            StackPanel finalStack = new StackPanel();

            stack.Children.Add(finalStack);
            var button = GetGamingButton("Select Card", nameof(ActionDoAgainViewModel.SelectCardAsync)); // i think

            finalStack.Children.Add(button);
            button = GetGamingButton("View Card", nameof(ActionDoAgainViewModel.ViewCard));
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
예제 #6
0
        public void Init(MainSetsObservable <SU, CO, RU, SE, T> thisMod, string tagUsed)
        {
            _tagUsed               = tagUsed;
            _thisStack             = new StackLayout();
            _thisStack.Orientation = StackOrientation.Horizontal;
            IndividualRummySetXF <SU, CO, RU, GC, GW, SE, T> thisTemp;
            Grid       firstGrid  = new Grid();
            ScrollView thisScroll = new ScrollView();

            thisScroll.Orientation = ScrollOrientation.Both;
            if (thisMod.HasFrame == true)
            {
                Text = thisMod.Text;
                var thisRect = ThisFrame.GetControlArea();
                thisScroll.Margin = new Thickness((double)thisRect.Left + (float)3, (double)thisRect.Top + (float)3, 3, 5); // try this way.
                firstGrid.Children.Add(ThisDraw);
                firstGrid.Children.Add(thisScroll);
            }
            else
            {
                firstGrid.Children.Add(thisScroll);// this alone.
            }
            _setList = thisMod.SetList;
            foreach (var thisSet in thisMod.SetList)
            {
                thisTemp             = new IndividualRummySetXF <SU, CO, RU, GC, GW, SE, T>();
                thisTemp.Divider     = Divider;
                thisTemp.Additionals = Additionals;
                thisTemp.LoadList(thisSet, tagUsed);
                _thisStack.Children.Add(thisTemp);
            }
            _setList.CollectionChanged += SetList_CollectionChanged;
            thisScroll.Content          = _thisStack;
            Content = firstGrid;
        }
예제 #7
0
        public void LoadLists(PickelCardGameVMData model)
        {
            NumberChooserWPF firstBid = new NumberChooserWPF();

            firstBid.Columns = 7;
            Text             = "Bid Info";
            EnumPickerWPF <DeckPieceCP, DeckPieceWPF, EnumSuitList> firstSuit = new EnumPickerWPF <DeckPieceCP, DeckPieceWPF, EnumSuitList>();
            var        thisRect  = ThisFrame.GetControlArea();
            StackPanel thisStack = new StackPanel();

            SetUpMarginsOnParentControl(thisStack, thisRect);
            firstBid.Margin  = new Thickness(3, 3, 3, 3);
            firstSuit.Margin = new Thickness(3, 3, 3, 3);
            firstSuit.LoadLists(model.Suit1 !);
            firstBid.LoadLists(model.Bid1 !);
            thisStack.Children.Add(firstBid);
            thisStack.Children.Add(firstSuit);
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            GamePackageViewModelBinder.ManuelElements.Clear();
            Button button = GetGamingButton("Place Bid", nameof(PickelBidViewModel.ProcessBidAsync));

            GamePackageViewModelBinder.ManuelElements.Add(button);
            otherStack.Children.Add(button);
            button = GetGamingButton("Pass", nameof(PickelBidViewModel.PassAsync));
            otherStack.Children.Add(button);
            GamePackageViewModelBinder.ManuelElements.Add(button);
            thisStack.Children.Add(otherStack);
            Grid thisGrid = new Grid();

            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(thisStack);
            Content = thisGrid;
        }
        public void LoadList(ScatteringPiecesObservable <CA, LI> mod, string tagUsed)
        {
            EventAggregator thisE = Resolve <EventAggregator>();

            thisE.Subscribe(this);
            SetBinding(TextProperty, nameof(ScatteringPiecesObservable <CA, LI> .TextToAppear));
            SetBinding(IsEnabledProperty, nameof(ScatteringPiecesObservable <CA, LI> .IsEnabled));
            _thisMod    = mod;
            DataContext = _thisMod; // so it can do the text and isenabled.
            _tagUsed    = tagUsed;
            _objectList = mod.RemainingList;
            _objectList.CollectionChanged += ObjectList_CollectionChanged;
            _thisCanvas        = new Canvas();
            _thisCanvas.Height = _thisMod.MaxSize.Height;
            _thisCanvas.Width  = _thisMod.MaxSize.Width;
            Grid tirstGrid = new Grid();

            tirstGrid.Children.Add(ThisDraw);
            ScrollViewer thisScroll = new ScrollViewer();

            thisScroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            thisScroll.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            thisScroll.Content = _thisCanvas;
            tirstGrid.Children.Add(thisScroll);
            if (Text == "" && _thisMod.TextToAppear != "")
            {
                throw new BasicBlankException("The bindings did not even work for text");
            }
            var thisRect = ThisFrame.GetControlArea();

            thisScroll.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 3, 3, 5); // try this way.
            PopulateCards();
            MouseUp += BoneYardWPF_MouseUp;
            Content  = tirstGrid;
        }
        public ScoreView(ThinkTwiceVMData model)
        {
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            StackPanel stack = new StackPanel();

            Text = model.DisplayScoreText;
            SetBinding(IsEnabledProperty, new Binding(nameof(ScoreViewModel.IsEnabled))); // this needs bindings

            var rect = ThisFrame.GetControlArea();

            stack.Margin = new Thickness((double)rect.Left + (float)3, (double)rect.Top + 10, 3, 3); // try this way.
            Button button;

            foreach (var thisItem in model.TextList)
            {
                button = GetButtonNormalButton(thisItem);
                stack.Children.Add(button);
            }
            StackPanel finalStack = new StackPanel();

            finalStack.Orientation = Orientation.Horizontal;
            button = GetGamingButton("Your Score", nameof(ScoreViewModel.CalculateScoreAsync));
            finalStack.Children.Add(button);
            button = GetGamingButton("Description", nameof(ScoreViewModel.ScoreDescriptionAsync));
            finalStack.Children.Add(button);
            stack.Children.Add(finalStack);
            grid.Children.Add(stack);
            Content = grid;
        }
        //public int ItemHeight
        //{
        //    get
        //    {
        //        return _list.ItemHeight;
        //    }
        //    set
        //    {
        //        _list.ItemHeight = value;
        //    }
        //}
        //public int ItemWidth
        //{
        //    get
        //    {
        //        return _list.ItemWidth;
        //    }
        //    set
        //    {
        //        _list.ItemWidth = value;
        //    }
        //}

        public PlayerUI(ActionContainer actionContainer, bool usePlayerButton, int itemHeight = 40, int itemWidth = 300)
        {
            GamePackageViewModelBinder.ManuelElements.Clear();
            Text = "Player List";
            StackPanel thisStack = new StackPanel();
            SKRect     thisRect  = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(thisStack, thisRect); //i think.
            _list.ItemHeight = itemHeight;
            _list.ItemWidth  = itemWidth;
            _list.LoadLists(actionContainer.Player1 !);
            thisStack.Children.Add(_list);
            if (usePlayerButton)
            {
                var button = GetGamingButton("Choose Player", nameof(ActionTakeUseViewModel.ChoosePlayerAsync)); // i think
                GamePackageViewModelBinder.ManuelElements.Add(button);                                           //try this too.
                var bind = GetVisibleBinding(nameof(ActionContainer.ButtonChoosePlayerVisible));
                button.SetBinding(VisibilityProperty, bind);
                thisStack.Children.Add(button);
            }
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(thisStack);
            Content = grid;
        }
        public void Init(DeckObservablePile <CA> cardModel, string tagUsed)
        {
            DataContext = cardModel;
            _tagUsed    = tagUsed;
            _thisMod    = cardModel;
            if (_thisMod.DrawInCenter == true)
            {
                CanDrawText = false;
                _thisNumber = new NumberPieceWPF();
                _thisNumber.CanHighlight = false; // not this time.
                _thisNumber.TextColor    = SKColors.SeaGreen;
                _thisNumber.Margin       = new Thickness(2, 2, 2, 2);
            }
            SetBinding(TextProperty, nameof(DeckObservablePile <CA> .TextToAppear));
            SetBinding(IsEnabledProperty, nameof(DeckObservablePile <CA> .IsEnabled));
            _thisGrid           = new Grid();
            _thisObject         = new GW();
            HorizontalAlignment = HorizontalAlignment.Left;
            VerticalAlignment   = VerticalAlignment.Top;
            CA temps = new CA();

            if (temps.DefaultSize.Height == 0 || temps.DefaultSize.Width == 0)
            {
                throw new BasicBlankException("The width and height cannot be 0.  Rethink");
            }
            _thisObject.SendSize(tagUsed, temps); //i think
            _thisObject.DataContext = cardModel.CurrentDisplayCard;
            Binding thisBind = new Binding(nameof(DeckObservablePile <CA> .DeckObjectClickedCommand));

            thisBind.Source = _thisMod; // has to be that one
            _thisObject.SetBinding(GraphicsCommand.CommandProperty, thisBind);
            //if we need visible, rethink.
            //SetBinding(VisibilityProperty, GetVisibleBinding(nameof(DeckViewModel<CA>.Visible)));
            if (_thisMod.DrawInCenter == false)
            {
                var thisRect = ThisFrame.GetControlArea(); //i think only if no center.  try this way.
                SetUpMarginsOnParentControl(_thisObject, thisRect);
                _objectLocation = new SKPoint(thisRect.Left, thisRect.Top);
            }
            else
            {
                _thisObject.Margin = new Thickness(2, 2, 2, 2);
                _objectLocation    = new SKPoint(2, 2);
            }
            EventAggregator thisE = Resolve <EventAggregator>();

            thisE.Subscribe(this, EnumNewCardCategories.Deck.ToString());
            _thisGrid.Children.Add(ThisDraw);
            _thisGrid.Children.Add(_thisObject);
            if (_thisMod.DrawInCenter == true)
            {
                _thisNumber !.Height    = _thisObject.ObjectSize.Height;
                _thisNumber.Width       = _thisObject.ObjectSize.Width;
                _thisNumber.NumberValue = int.Parse(_thisMod.TextToAppear);
                _thisNumber.Init();
                _thisGrid.Children.Add(_thisNumber); // so this goes on top  hopefully animations still work (?)
            }
            Content = _thisGrid;
            _thisObject.Init(); // this should be okay.  will do the right thing afterall
        }
예제 #12
0
        public ActionDirectionView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            Text = "Direction";
            StackPanel stack = new StackPanel();
            SKRect     rect  = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(stack, rect); //i think.
            ListChooserWPF list = new ListChooserWPF();

            list.ItemHeight = 60;
            list.LoadLists(actionContainer.Direction1 !);
            stack.Children.Add(list);
            var button = GetGamingButton("Choose Direction", nameof(ActionDirectionViewModel.DirectionAsync));

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(otherStack);
            otherStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = ActionHelpers.GetFinalStack(grid, model, actionContainer, keeperContainer);
        }
예제 #13
0
        public RookBiddingView(RookVMData model)
        {
            NumberChooserWPF firstBid = new NumberChooserWPF();

            firstBid.Columns = 7;
            Text             = "Bid Info";
            var        rect  = ThisFrame.GetControlArea();
            StackPanel stack = new StackPanel();

            SetUpMarginsOnParentControl(stack, rect);
            firstBid.LoadLists(model.Bid1 !);
            stack.Children.Add(firstBid);
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(otherStack);
            Button button = GetGamingButton("Place Bid", nameof(RookBiddingViewModel.BidAsync));

            otherStack.Children.Add(button);
            button = GetGamingButton("Pass", nameof(RookBiddingViewModel.PassAsync));
            otherStack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = grid;
        }
예제 #14
0
        public void LoadList(Pinochle2PlayerVMData model)
        {
            Text      = "Scoring Guide";
            _thisGrid = new Grid();
            var thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(_thisGrid, thisRect);
            AddAutoColumns(_thisGrid, 2);
            AddAutoRows(_thisGrid, 20);
            var thisLabel = GetLargestLabel("Point Values:");

            AddControlToGrid(_thisGrid, thisLabel, 0, 0);
            _rowNumber = 1;
            model.Guide1 !.PointValueList.ForEach(thisScore => AddStandardLabel(thisScore));
            thisLabel = GetLargestLabel("Value Of Melds:");
            AddControlToGrid(_thisGrid, thisLabel, _rowNumber, 0);
            _rowNumber++;
            thisLabel = GetClassLabel("A");
            AddControlToGrid(_thisGrid, thisLabel, _rowNumber, 0);
            _rowNumber++;
            model.Guide1.ClassAList.ForEach(thisScore => AddStandardLabel(thisScore));
            thisLabel = GetClassLabel("B");
            AddControlToGrid(_thisGrid, thisLabel, _rowNumber, 0);
            _rowNumber++;
            model.Guide1.ClassBList.ForEach(thisScore => AddStandardLabel(thisScore));
            thisLabel = GetClassLabel("C");
            AddControlToGrid(_thisGrid, thisLabel, _rowNumber, 0);
            _rowNumber++;
            model.Guide1.ClassCList.ForEach(thisScore => AddStandardLabel(thisScore));
            Grid finalGrid = new Grid();

            finalGrid.Children.Add(ThisDraw);
            finalGrid.Children.Add(_thisGrid);
            Content = finalGrid;
        }
예제 #15
0
        public void LoadList(SorryCardGamePlayerItem tempPlayer, CommandContainer command)
        {
            _thisPlayer = tempPlayer;
            StackPanel thisStack = new StackPanel();

            thisStack.Orientation = Orientation.Horizontal;
            _clickCommand         = tempPlayer.GetPlainCommand(command, nameof(SorryCardGamePlayerItem.SorryPlayerAsync)); //not just player anymore.
            _thisList             = new CustomBasicList <CardGraphicsWPF>();
            for (int x = 1; x <= 4; x++)
            {
                var thisCard = new CardGraphicsWPF();
                _thisList.Add(thisCard);
                thisCard.SendSize("", new SorryCardGameCardInformation());
                thisCard.DataContext = null;
                thisStack.Children.Add(thisCard);
            }
            Text        = _thisPlayer.NickName;
            DataContext = _thisPlayer;
            var thisRect = ThisFrame.GetControlArea();

            thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            var thisGrid = new Grid();

            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(thisStack);
            Content = thisGrid;
            _clickCommand !.CanExecuteChanged += ClickCommandChange;
            MouseUp += BoardWPF_MouseUp;
            _thisPlayer.PropertyChanged += ThisPlayerPropertyChange;
            RefreshList();
        }
        public void LoadControls(MonopolyCardGameVMData model)
        {
            _thisDetail          = model.AdditionalInfo1;
            Text                 = "Card Information";
            _thisDetail !.Change = this;
            Grid   tempGrid = new Grid();
            SKRect thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(tempGrid, thisRect); //i think.
            AddAutoColumns(tempGrid, 1);
            AddLeftOverColumn(tempGrid, 1);
            _thisG                  = new CardGraphicsWPF();
            _thisLabel              = GetDefaultLabel();
            _thisLabel.Text         = _thisDetail.CurrentCard.Description;
            _thisLabel.TextWrapping = TextWrapping.Wrap;
            _thisG.SendSize("", _thisDetail.CurrentCard);
            AddControlToGrid(tempGrid, _thisG, 0, 0);
            _thisLabel.Margin = new Thickness(10, 3, 5, 3);
            AddControlToGrid(tempGrid, _thisLabel, 0, 1);
            Grid thisGrid = new Grid();

            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(tempGrid);
            Content = thisGrid;
        }
        public void LoadList(DominosRegularVMData model, IGamePackageResolver resolver)
        {
            _model = model;
            IProportionImage thisP = resolver.Resolve <IProportionImage>(ts.TagUsed);

            Text      = "Display";
            _thisGrid = new Grid();
            Grid finalGrid = new Grid();

            _dominoList = _model.GameBoard1 !.DominoList;
            _dominoList.CollectionChanged += DominoCollectionChange;
            if (_dominoList.Count != 3)
            {
                throw new BasicBlankException("Only 3 dominos are supported");
            }
            if (_dominoList.First().DefaultSize.Width == 0)
            {
                throw new BasicBlankException("The width can never be 0 for dominos");
            }
            SKSize thisSize = _dominoList.First().DefaultSize.GetSizeUsed(thisP.Proportion);
            int    pixels   = (int)thisSize.Width / 2;

            for (int x = 0; x < 4; x++)
            {
                AddPixelColumn(_thisGrid, pixels);
            }
            RepopulateList();
            var thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(_thisGrid, thisRect);
            finalGrid.Children.Add(ThisDraw);
            finalGrid.Children.Add(_thisGrid);
            Content = finalGrid;
        }
예제 #18
0
        public ShowCardUI(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer, EnumShowCategory category)
        {
            DataContext = actionContainer;
            switch (category)
            {
            case EnumShowCategory.MainScreen:
                Text    = "Card Information";
                _detail = model.CardDetail;
                break;

            case EnumShowCategory.CurrentAction:
                Text = "Current Card Information";
                //var thisAction1 = (ActionViewModel)thisMod.Action1!;
                _detail = actionContainer.CurrentDetail;
                break;

            case EnumShowCategory.MainAction:
                SetBinding(TextProperty, new Binding(nameof(ActionContainer.ActionFrameText)));
                //var thisAction2 = (ActionViewModel)thisMod.Action1!;
                _detail = actionContainer.ActionDetail;
                break;

            case EnumShowCategory.KeeperScreen:
                Text = "Current Card Information";
                //var thisKeeper = (KeeperViewModel)thisMod.KeeperControl1!;
                _detail = keeperContainer.CardDetail;
                break;

            default:
                throw new BasicBlankException("Category Not Found");
            }
            _detail !.Card = this;
            Grid   tempGrid = new Grid();
            SKRect thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(tempGrid, thisRect); //i think.
            AddAutoColumns(tempGrid, 1);
            AddLeftOverColumn(tempGrid, 1);
            _graphics           = new CardGraphicsWPF();
            _label              = GetDefaultLabel();
            _label.Text         = _detail.CurrentCard.Description;
            _label.TextWrapping = TextWrapping.Wrap;
            _graphics.SendSize("", _detail.CurrentCard);
            AddControlToGrid(tempGrid, _graphics, 0, 0);
            _label.Margin = new Thickness(10, 3, 5, 3);
            AddControlToGrid(tempGrid, _label, 0, 1);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(tempGrid);
            Content = grid;
        }
예제 #19
0
        public void LoadList(RummyDiceHandVM thisMod, RummyDiceMainGameClass mainGame)
        {
            _thisMod    = thisMod;
            _mainGame   = mainGame;
            DataContext = thisMod;
            _handList   = thisMod.HandList;
            _handList.CollectionChanged += HandList_CollectionChanged;
            Text = $"Temp Set {thisMod.Index}";
            SetBinding(IsEnabledProperty, nameof(RummyDiceHandVM.IsEnabled));
            RummyDiceInfo firstDice = new RummyDiceInfo();

            if (firstDice.HeightWidth == 0)
            {
                throw new BasicBlankException("You must specify the height/width of the dice");
            }
            IProportionImage thisI     = new CustomProportionWPF();
            SKSize           firstSize = new SKSize(firstDice.HeightWidth, firstDice.HeightWidth);
            var  sizeUsed  = firstSize.GetSizeUsed(thisI.Proportion);
            Grid firstGrid = new Grid();

            GridHelper.AddPixelRow(firstGrid, (int)sizeUsed.Height + 50);
            GridHelper.AddLeftOverRow(firstGrid, 1);
            Margin                 = new Thickness(3, 3, 3, 3);
            _thisStack             = new StackPanel();
            _thisStack.Orientation = Orientation.Horizontal;
            Button thisBut = GetGamingButton("Place Tiles", nameof(RummyDiceHandVM.BoardCommand));

            //i think since its a different view model, has to do manually.
            thisBut.Name    = "";
            thisBut.Command = thisMod.BoardCommand;
            thisBut.Margin  = new Thickness(5, 5, 5, 5);
            GridHelper.AddControlToGrid(firstGrid, _thisStack, 0, 0);
            GridHelper.AddControlToGrid(firstGrid, thisBut, 1, 0);
            _thisGrid = new Grid();
            //hopefully does not need visible.  if we need visible, rethink.


            //SetBinding(VisibilityProperty, GetVisibleBinding(nameof(RummyDiceHandVM.Visible)));
            _thisGrid.Children.Add(ThisDraw);
            _thisGrid.Children.Add(firstGrid);
            var thisRect = ThisFrame.GetControlArea();

            _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            Width             = 1520; //different on xamarin forms.
            Height            = 250;
            PopulateControls();       //just in case there is something to start with.
            Content = _thisGrid;
        }
예제 #20
0
        public void LoadList(RummyDiceHandVM thisMod, RummyDiceMainGameClass mainGame)
        {
            _thisMod                     = thisMod;
            _mainGame                    = mainGame;
            BindingContext               = thisMod;
            HorizontalOptions            = LayoutOptions.FillAndExpand; //hopefully this works too.
            _handList                    = thisMod.HandList;
            _handList.CollectionChanged += HandList_CollectionChanged;
            Text = $"Temp Set {thisMod.Index}";
            SetBinding(IsEnabledProperty, new Binding(nameof(RummyDiceHandVM.IsEnabled)));
            RummyDiceInfo firstDice = new RummyDiceInfo();

            if (firstDice.HeightWidth == 0)
            {
                throw new BasicBlankException("You must specify the height/width of the dice");
            }
            IProportionImage thisI     = new CustomProportionXF();
            SKSize           firstSize = new SKSize(firstDice.HeightWidth, firstDice.HeightWidth);
            var sizeUsed = firstSize.GetSizeUsed(thisI.Proportion);

            Margin                 = new Thickness(3, 3, 3, 3);
            _thisStack             = new StackLayout();
            _thisStack.Orientation = StackOrientation.Horizontal;
            _thisStack.Spacing     = 0;
            Button thisBut = GetSmallerButton("Place Tiles", "");

            thisBut.Command = thisMod.BoardCommand; //i think this way this time.
            StackLayout finalStack = new StackLayout();

            finalStack.Orientation = StackOrientation.Horizontal;
            finalStack.Children.Add(thisBut);
            finalStack.Spacing = 2;
            finalStack.Children.Add(_thisStack);
            thisBut.HorizontalOptions    = LayoutOptions.Start;
            thisBut.VerticalOptions      = LayoutOptions.Start;
            _thisStack.HorizontalOptions = LayoutOptions.FillAndExpand;
            thisBut.FontSize            *= .7f;
            _thisGrid = new Grid();
            _thisGrid.Children.Add(ThisDraw);
            _thisGrid.Children.Add(finalStack);
            var thisRect = ThisFrame.GetControlArea();

            thisBut.Margin    = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            PopulateControls(); //just in case there is something to start with.
            Content = _thisGrid;
        }
예제 #21
0
        public void LoadControls(FluxxGameContainer gameContainer)
        {
            Text      = "Rule Information";
            _ruleList = gameContainer.SaveRoot !.RuleList;
            _ruleList.CollectionChanged += RuleListChange;
            _stack = new StackPanel();
            Grid grid = new Grid();

            Width = 200;
            SKRect rect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(_stack, rect); //i think.
            grid.Children.Add(ThisDraw);
            grid.Children.Add(_stack);
            Content = grid;
            LoadRules();
        }
예제 #22
0
        public void Init(PokerMainViewModel thisMod)
        {
            NumberChooserWPF thisNumber = new NumberChooserWPF();

            thisNumber.Columns = 3;
            thisNumber.Rows    = 1;
            thisNumber.LoadLists(thisMod.Bet1 !);
            Text = "Bet Information";
            var thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(thisNumber, thisRect);
            Grid thisGrid = new Grid();

            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(thisNumber);
            Content = thisGrid;
        }
        public SkuckSuitView(SkuckCardGameVMData model)
        {
            Text = "Trump Info";
            Grid       grid      = new Grid();
            var        rect      = ThisFrame.GetControlArea();
            StackPanel thisStack = new StackPanel();

            SetUpMarginsOnParentControl(thisStack, rect);
            EnumPickerWPF <DeckPieceCP, DeckPieceWPF, EnumSuitList> thisSuit = new EnumPickerWPF <DeckPieceCP, DeckPieceWPF, EnumSuitList>();

            thisStack.Children.Add(thisSuit);
            thisSuit.LoadLists(model.Suit1 !);
            Button thisBut = GetGamingButton("Choose Trump Suit", nameof(SkuckSuitViewModel.TrumpAsync));

            thisStack.Children.Add(thisBut);
            grid.Children.Add(ThisDraw);
            grid.Children.Add(thisStack);
            Content = grid;
        }
예제 #24
0
        public SkuckChoosePlayView()
        {
            Text = "Choose Play Or Pass Options";
            Grid       grid  = new Grid();
            var        rect  = ThisFrame.GetControlArea();
            StackPanel stack = new StackPanel();

            SetUpMarginsOnParentControl(stack, rect);
            Button button = GetGamingButton("Play", nameof(SkuckChoosePlayViewModel.FirstPlayAsync));

            button.CommandParameter = EnumChoiceOption.Play;
            stack.Children.Add(button);
            button = GetGamingButton("Pass", nameof(SkuckChoosePlayViewModel.FirstPlayAsync));
            button.CommandParameter = EnumChoiceOption.Pass;
            stack.Children.Add(button);
            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = grid;
        }
예제 #25
0
        public SkuckBiddingView(SkuckCardGameVMData model)
        {
            Text = "Bid Info";
            Grid       grid      = new Grid();
            var        rect      = ThisFrame.GetControlArea();
            StackPanel thisStack = new StackPanel();

            SetUpMarginsOnParentControl(thisStack, rect);
            NumberChooserWPF bid = new NumberChooserWPF();

            bid.Columns = 9;
            bid.LoadLists(model.Bid1 !);
            thisStack.Children.Add(bid);
            Button button = GetGamingButton("Place Bid", nameof(SkuckBiddingViewModel.BidAsync));

            thisStack.Children.Add(button);
            grid.Children.Add(ThisDraw);
            grid.Children.Add(thisStack);
            Content = grid;
        }
        public void Init(CribbagePatienceMainViewModel thisMod)
        {
            _thisMod   = thisMod;
            Text       = "Score Summary";
            _scoreList = thisMod.Scores !.ScoreList;
            _scoreList.CollectionChanged += CollectionChanged;
            Grid parentGrid = new Grid();

            _thisGrid = new Grid();
            AddPixelColumn(_thisGrid, 150);
            AddAutoColumns(_thisGrid, 1);
            var thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(_thisGrid, thisRect);
            parentGrid.Children.Add(ThisDraw);
            parentGrid.Children.Add(_thisGrid);
            HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            PopulateList();
            Content = parentGrid;
        }
예제 #27
0
        public async Task InitAsync(MonasteryCardGameVMData model, IUIView view, IEventAggregator aggregator)
        {
            _view       = view;
            _aggregator = aggregator;
            Text        = "Mission List";
            _thisList   = model.CompleteMissions;
            Grid mainGrid = new Grid();
            var  thisRect = ThisFrame.GetControlArea();

            _thisGrid        = new Grid();
            _thisGrid.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            AddAutoRows(_thisGrid, 6);
            AddLeftOverColumn(_thisGrid, 50);
            AddLeftOverColumn(_thisGrid, 50);
            mainGrid.Children.Add(ThisDraw);
            mainGrid.Children.Add(_thisGrid);
            await PopulateListAsync();

            _thisList.CollectionChanged += ListChange;
            Content = mainGrid;
        }
예제 #28
0
        protected override void FirstSetUp()
        {
            _thisHelp         = new SimpleLabelGridXF();
            HorizontalOptions = LayoutOptions.Start;
            VerticalOptions   = LayoutOptions.Start;
            base.FirstSetUp();
            Grid firstGrid = new Grid();

            firstGrid.Children.Add(ThisDraw);
            ScrollView thisScroll = new ScrollView();

            Text = "Additional Information"; // defaults to that but its adjustable
            var thisRect = ThisFrame.GetControlArea();

            thisScroll.Margin      = new Thickness(thisRect.Left + 3, thisRect.Top + 3, 3, 5); // try this way.
            _mainGrid              = _thisHelp.GetContent;                                     // hopefully as i add to it, its still okay.
            thisScroll.Orientation = ScrollOrientation.Both;
            thisScroll.Content     = _mainGrid;
            firstGrid.Children.Add(thisScroll);
            Content = firstGrid;
        }
예제 #29
0
        public void LoadList(SixtySix2PlayerVMData model)
        {
            Text      = "Scoring Guide";
            _thisGrid = new Grid();
            var thisRect = ThisFrame.GetControlArea();

            SetUpMarginsOnParentControl(_thisGrid, thisRect);
            AddAutoColumns(_thisGrid, 2);
            AddAutoRows(_thisGrid, 9);
            var thisLabel = GetLargestLabel("Point Values:");

            AddControlToGrid(_thisGrid, thisLabel, 0, 0);
            _rowNumber = 1;
            var thisList = model.GetDescriptionList();

            thisList.ForEach(thisscore => AddStandardLabel(thisscore));
            Grid finalGrid = new Grid();

            finalGrid.Children.Add(ThisDraw);
            finalGrid.Children.Add(_thisGrid);
            Content = finalGrid;
        }
예제 #30
0
        public SpadesBiddingView(Spades2PlayerVMData model)
        {
            NumberChooserWPF firstBid = new NumberChooserWPF();

            firstBid.Columns = 7;
            Text             = "Bid Info";
            var        rect  = ThisFrame.GetControlArea();
            StackPanel stack = new StackPanel();

            SetUpMarginsOnParentControl(stack, rect);
            firstBid.Margin = new Thickness(3, 3, 3, 3);
            firstBid.LoadLists(model.Bid1 !);
            stack.Children.Add(firstBid);
            Button button = GetGamingButton("Place Bid", nameof(SpadesBiddingViewModel.BidAsync));

            stack.Children.Add(button);
            Grid grid = new Grid();

            grid.Children.Add(ThisDraw);
            grid.Children.Add(stack);
            Content = grid;
        }