public TileRummyMainView(IEventAggregator aggregator, TileRummyVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _score = new ScoreBoardWPF(); _hand1 = new BaseHandWPF <TileInfo, TileCP, TileWPF>(); _pool1 = new BoneYardWPF <TileInfo, TileCP, TileWPF, TileShuffler>(); _tempG = new TempRummySetsWPF <EnumColorType, EnumColorType, TileInfo, TileCP, TileWPF>(); _mainG = new MainRummySetsWPF <EnumColorType, EnumColorType, TileInfo, TileCP, TileWPF, TileSet, SavedSet>(); var endButton = GetGamingButton("End Turn", nameof(TileRummyMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; var firstButton = GetGamingButton("Create First Sets", nameof(TileRummyMainViewModel.CreateFirstSetsAsync)); var otherButton = GetGamingButton("Create New Set", nameof(TileRummyMainViewModel.CreateNewSetAsync)); var undoButton = GetGamingButton("Reset Moves", nameof(TileRummyMainViewModel.UndoMoveAsync)); _score.AddColumn("Tiles Left", true, nameof(TileRummyPlayerItem.ObjectCount)); _score.AddColumn("Score", true, nameof(TileRummyPlayerItem.Score)); _tempG.Height = 250; _pool1.Width = 300; // well see. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(TileRummyMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(TileRummyMainViewModel.Status)); var firstContent = firstInfo.GetContent; Grid completeGrid = new Grid(); AddLeftOverRow(completeGrid, 50); AddAutoRows(completeGrid, 1); AddLeftOverRow(completeGrid, 50); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_pool1); StackPanel stack = new StackPanel(); stack.Children.Add(firstButton); stack.Children.Add(otherButton); stack.Children.Add(undoButton); stack.Children.Add(endButton); otherStack.Children.Add(stack); stack = new StackPanel(); stack.Children.Add(_tempG); stack.Children.Add(firstContent); stack.Children.Add(_score); otherStack.Children.Add(stack); AddControlToGrid(completeGrid, otherStack, 0, 0); AddControlToGrid(completeGrid, _hand1, 1, 0); _pool1.Margin = new Thickness(2, 2, 2, 2); AddControlToGrid(completeGrid, _mainG, 2, 0); // used the wrong one. Content = completeGrid; }
public OldMaidMainView(IEventAggregator aggregator, TestOptions test, OldMaidVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _discardGPile = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _playerHandWPF = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _playerHandWPF.Divider = 2; StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(OldMaidMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(OldMaidMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(OldMaidMainViewModel.Status)); var endButton = GetGamingButton("End Turn", nameof(OldMaidMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(endButton); ParentSingleUIContainer opponent = new ParentSingleUIContainer() { Name = nameof(OldMaidMainViewModel.OpponentScreen) }; mainStack.Children.Add(opponent); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(otherStack); mainStack.Children.Add(firstInfo.GetContent); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public OpponentCardsView(OldMaidVMData model) { BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> > hand = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); hand.Divider = 2; hand.LoadList(model.OpponentCards1, ts.TagUsed); Content = hand; }
public CaliforniaJackMainView(IEventAggregator aggregator, TestOptions test, CaliforniaJackVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <CaliforniaJackCardInformation, ts, DeckOfCardsWPF <CaliforniaJackCardInformation> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <CaliforniaJackCardInformation, ts, DeckOfCardsWPF <CaliforniaJackCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, CaliforniaJackCardInformation, ts, DeckOfCardsWPF <CaliforniaJackCardInformation> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(CaliforniaJackMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", false, nameof(CaliforniaJackPlayerItem.ObjectCount)); //very common. _score.AddColumn("Tricks Won", true, nameof(CaliforniaJackPlayerItem.TricksWon), rightMargin: 10); _score.AddColumn("Points", true, nameof(CaliforniaJackPlayerItem.Points), rightMargin: 10); _score.AddColumn("Total Score", true, nameof(CaliforniaJackPlayerItem.TotalScore), rightMargin: 10); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(CaliforniaJackMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(CaliforniaJackMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(CaliforniaJackMainViewModel.Status)); mainStack.Children.Add(_trick1); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public CribbagePatienceMainView(IEventAggregator aggregator) { _aggregator = aggregator; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); StackPanel stack = new StackPanel(); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _deckGPile.HorizontalAlignment = HorizontalAlignment.Left; _deckGPile.VerticalAlignment = VerticalAlignment.Top; _hand1Score = new ScoreHandCribUI(); _hand2Score = new ScoreHandCribUI(); _cribScore = new ScoreHandCribUI(); _score1 = new ScoreSummaryUI(); _yourHand = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _cribHand = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); SetMargins(_score1); SetMargins(_hand1Score); SetMargins(_hand2Score); SetMargins(_cribScore); SetMargins(_cribHand); SetMargins(_yourHand); //i think should be this too. Grid grid = new Grid(); AddLeftOverRow(grid, 40); AddLeftOverRow(grid, 60); AddAutoRows(grid, 1); AddAutoColumns(grid, 1); AddLeftOverColumn(grid, 40); AddLeftOverColumn(grid, 40); AddControlToGrid(grid, stack, 2, 0); Grid.SetColumnSpan(stack, 3); stack.Orientation = Orientation.Horizontal; var cributton = GetGamingButton("To Crib", nameof(CribbagePatienceMainViewModel.CribAsync)); var continueButton = GetGamingButton("Continue", nameof(CribbagePatienceMainViewModel.Continue)); stack.Children.Add(cributton); stack.Children.Add(continueButton); StackPanel otherStack = new StackPanel() { Orientation = Orientation.Horizontal }; stack = new StackPanel(); otherStack.Children.Add(_deckGPile); _startCard = new BasePileWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); otherStack.Children.Add(_startCard); stack.Children.Add(otherStack); stack.Children.Add(_yourHand); AddControlToGrid(grid, stack, 1, 0); AddControlToGrid(grid, _cribHand, 0, 0); AddControlToGrid(grid, _score1, 0, 2); _grid = grid; Content = grid; }
public ItalianDominosMainView(IEventAggregator aggregator, TestOptions test, ItalianDominosVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(ItalianDominosMainViewModel.RestoreScreen) }; } _bone = new BoneYardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo>, DominosBasicShuffler <SimpleDominoInfo> >(); _playerHandWPF = new BaseHandWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> >(); _score = new ScoreBoardWPF(); _bone.Height = 400; _bone.Width = 800; //can adjust as needed. mainStack.Children.Add(_bone); mainStack.Children.Add(_playerHandWPF); //anything else to add can be done as well. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(ItalianDominosMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(ItalianDominosMainViewModel.Status)); firstInfo.AddRow("Up To", nameof(ItalianDominosMainViewModel.UpTo)); firstInfo.AddRow("Next #", nameof(ItalianDominosMainViewModel.NextNumber)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; var thisBut = GetGamingButton("Play", nameof(ItalianDominosMainViewModel.PlayAsync)); otherStack.Children.Add(thisBut); _score.AddColumn("Total Score", true, nameof(ItalianDominosPlayerItem.TotalScore), rightMargin: 10); _score.AddColumn("Dominos Left", true, nameof(ItalianDominosPlayerItem.ObjectCount), rightMargin: 10); // if not important, can just comment _score.AddColumn("Drew Yet", true, nameof(ItalianDominosPlayerItem.DrewYet), useTrueFalse: true); otherStack.Children.Add(firstInfo.GetContent); otherStack.Children.Add(_score); mainStack.Children.Add(otherStack); // this may be missing as well. if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public MailListView(PaydayVMData model) { BaseHandWPF <MailCard, CardGraphicsCP, MailCardWPF> hand = new BaseHandWPF <MailCard, CardGraphicsCP, MailCardWPF>(); hand.HandType = HandObservable <MailCard> .EnumHandList.Vertical; hand.Height = 500; hand.HorizontalAlignment = HorizontalAlignment.Left; hand.LoadList(model.CurrentMailList, ""); Content = hand; }
public DominosRegularMainView(IEventAggregator aggregator, TestOptions test, DominosRegularVMData model, IGamePackageResolver resolver ) { _aggregator = aggregator; _model = model; _resolver = resolver; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(DominosRegularMainViewModel.RestoreScreen) }; } _bone = new BoneYardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo>, DominosBasicShuffler <SimpleDominoInfo> >(); _playerHandWPF = new BaseHandWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> >(); _score = new ScoreBoardWPF(); _gameBoard1 = new GameBoardUI(); _bone.Height = 300; _bone.Width = 800; //can adjust as needed. mainStack.Children.Add(_bone); mainStack.Children.Add(_gameBoard1); mainStack.Children.Add(_playerHandWPF); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(DominosRegularMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(DominosRegularMainViewModel.Status)); mainStack.Children.Add(firstInfo.GetContent); _score.AddColumn("Total Score", true, nameof(DominosRegularPlayerItem.TotalScore)); _score.AddColumn("Dominos Left", true, nameof(DominosRegularPlayerItem.ObjectCount)); // if not important, can just comment mainStack.Children.Add(_score); Button endTurn = GetGamingButton("End Turn", nameof(DominosRegularMainViewModel.EndTurnAsync)); endTurn.HorizontalAlignment = HorizontalAlignment.Left; mainStack.Children.Add(endTurn); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public PickelCardGameMainView(IEventAggregator aggregator, TestOptions test, PickelCardGameVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); GamePackageViewModelBinder.ManuelElements.Clear(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <PickelCardGameCardInformation, ts, DeckOfCardsWPF <PickelCardGameCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, PickelCardGameCardInformation, ts, DeckOfCardsWPF <PickelCardGameCardInformation> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(PickelCardGameMainViewModel.RestoreScreen) }; } PopulateScores(_score); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(PickelCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(PickelCardGameMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(PickelCardGameMainViewModel.Status)); mainStack.Children.Add(_trick1); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public AccordianSolitaireMainView(IEventAggregator aggregator) { _aggregator = aggregator; _aggregator.Subscribe(this); StackPanel stack = new StackPanel(); SimpleLabelGrid thisLabel = new SimpleLabelGrid(); thisLabel.AddRow("Score", nameof(AccordianSolitaireMainViewModel.Score)); _board = new BaseHandWPF <AccordianSolitaireCardInfo, ts, DeckOfCardsWPF <AccordianSolitaireCardInfo> >(); _board.Divider = 1.5f; stack.Children.Add(_board); stack.Children.Add(thisLabel.GetContent); Content = stack; //if not doing this, rethink. }
public RageCardGameMainView(IEventAggregator aggregator, TestOptions test, RageCardGameVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF>(); _trick1 = new SeveralPlayersTrickWPF <EnumColor, RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF, RageCardGamePlayerItem>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(RageCardGameMainViewModel.RestoreScreen) }; } PopulateScores(_score); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(RageCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(RageCardGameMainViewModel.Status)); firstInfo.AddRow("Trump", nameof(RageCardGameMainViewModel.TrumpSuit)); firstInfo.AddRow("Lead", nameof(RageCardGameMainViewModel.Lead)); mainStack.Children.Add(_trick1); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
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 void Init(TempSetsObservable <SU, CO, RU> thisMod, string tagUsed) { StackPanel thisStack = new StackPanel(); thisStack.Orientation = Orientation.Horizontal; BaseHandWPF <RU, GC, GW> thisHand; _handList = new CustomBasicList <BaseHandWPF <RU, GC, GW> >(); foreach (var ThisSet in thisMod.SetList) { thisHand = new BaseHandWPF <RU, GC, GW>(); thisHand.ExtraControlSpace = 20; thisHand.HandType = HandObservable <RU> .EnumHandList.Vertical; thisHand.MaximumWidthHeight = (float)Height - 20; thisHand.Divider = Divider; thisHand.Additionals = Additionals; thisHand.LoadList(ThisSet, tagUsed); _handList.Add(thisHand); thisStack.Children.Add(thisHand); } Content = thisStack; }
public XactikaMainView(IEventAggregator aggregator, TestOptions test, XactikaVMData model, IGamePackageRegister register, StatsBoardCP boardCP ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); register.RegisterControl(_stats1.Element, "main"); boardCP.LinkBoard(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <XactikaCardInformation, XactikaGraphicsCP, CardGraphicsWPF>(); _shape1 = new ChooseShapeWPF(); _trick1 = new SeveralPlayersTrickWPF <EnumShapes, XactikaCardInformation, XactikaGraphicsCP, CardGraphicsWPF, XactikaPlayerItem>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(XactikaMainViewModel.RestoreScreen) }; } _score.AddColumn("Cards Left", false, nameof(XactikaPlayerItem.ObjectCount)); //very common. _score.AddColumn("Bid Amount", false, nameof(XactikaPlayerItem.BidAmount)); _score.AddColumn("Tricks Won", false, nameof(XactikaPlayerItem.TricksWon)); _score.AddColumn("Current Score", false, nameof(XactikaPlayerItem.CurrentScore)); _score.AddColumn("Total Score", false, nameof(XactikaPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(XactikaMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(XactikaMainViewModel.Status)); firstInfo.AddRow("Round", nameof(XactikaMainViewModel.RoundNumber)); firstInfo.AddRow("Mode", nameof(XactikaMainViewModel.GameModeText)); StackPanel shapeStack = new StackPanel(); shapeStack.Children.Add(_shape1); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(XactikaMainViewModel.ShapeScreen) }; shapeStack.Children.Add(parent); Grid tempGrid = new Grid(); AddAutoRows(tempGrid, 1); AddLeftOverColumn(tempGrid, 1); AddAutoColumns(tempGrid, 2); StackPanel tempStack = new StackPanel(); tempStack.Orientation = Orientation.Horizontal; tempStack.Children.Add(_trick1); tempStack.Children.Add(shapeStack); AddControlToGrid(tempGrid, tempStack, 0, 0); parent = new ParentSingleUIContainer() { Name = nameof(XactikaMainViewModel.BidScreen) }; AddControlToGrid(tempGrid, parent, 0, 0); // if one is visible, then the other is not AddControlToGrid(tempGrid, _stats1, 0, 2); AddControlToGrid(tempGrid, _score, 0, 1); mainStack.Children.Add(tempGrid); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public Rummy500MainView(IEventAggregator aggregator, TestOptions test, Rummy500VMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _playerHandWPF.Margin = new Thickness(5, 5, 5, 5); _playerHandWPF.HorizontalAlignment = HorizontalAlignment.Stretch; _discardRummy = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _mainG = new MainRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard>, RummySet, SavedSet>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(Rummy500MainViewModel.RestoreScreen) }; } Grid finalGrid = new Grid(); AddAutoColumns(finalGrid, 1); AddLeftOverColumn(finalGrid, 1); AddControlToGrid(finalGrid, mainStack, 0, 1); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(Rummy500MainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(Rummy500MainViewModel.Status)); _score.AddColumn("Cards Left", false, nameof(Rummy500PlayerItem.ObjectCount)); //very common. _score.AddColumn("Points Played", false, nameof(Rummy500PlayerItem.PointsPlayed)); _score.AddColumn("Cards Played", false, nameof(Rummy500PlayerItem.CardsPlayed)); _score.AddColumn("Score Current", false, nameof(Rummy500PlayerItem.CurrentScore)); _score.AddColumn("Score Total", false, nameof(Rummy500PlayerItem.TotalScore)); otherStack.Children.Add(_score); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_playerHandWPF); Button button; button = GetGamingButton("Discard Current", nameof(Rummy500MainViewModel.DiscardCurrentAsync)); otherStack.Children.Add(button); button = GetGamingButton("Create New Rummy Set", nameof(Rummy500MainViewModel.CreateSetAsync)); otherStack.Children.Add(button); mainStack.Children.Add(otherStack); _mainG.Divider = 1.3; _mainG.Height = 550; // i think mainStack.Children.Add(_mainG); _discardRummy.Divider = 1.7; _discardRummy.HandType = HandObservable <RegularRummyCard> .EnumHandList.Vertical; _discardRummy.HorizontalAlignment = HorizontalAlignment.Left; _discardRummy.VerticalAlignment = VerticalAlignment.Stretch; AddControlToGrid(finalGrid, _discardRummy, 0, 0); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalGrid; }
public GalaxyCardGameMainView(IEventAggregator aggregator, TestOptions test, GalaxyCardGameVMData model, GalaxyCardGameGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _model.WinUI = this; _gameContainer = gameContainer; _aggregator.Subscribe(this); gameContainer.SaveRoot.LoadWin(this); _deckGPile = new BaseDeckWPF <GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> >(); _trick1.Width = 500; _nextCard = new DeckOfCardsWPF <GalaxyCardGameCardInformation>(); _planetStack = new StackPanel(); _moonGrid = new Grid(); _planetStack.Orientation = Orientation.Horizontal; AddLeftOverColumn(_moonGrid, 50); AddLeftOverColumn(_moonGrid, 50); AddAutoRows(_moonGrid, 1); _nextCard.SendSize(ts.TagUsed, _gameContainer.SaveRoot !.WinningCard); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(GalaxyCardGameMainViewModel.RestoreScreen) }; } var endButton = GetGamingButton("End Turn", nameof(GalaxyCardGameMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; endButton.VerticalAlignment = VerticalAlignment.Top; StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_trick1); otherStack.Children.Add(_nextCard); otherStack.Children.Add(_deckGPile); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", false, nameof(GalaxyCardGamePlayerItem.ObjectCount)); //very common. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(GalaxyCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(GalaxyCardGameMainViewModel.Status)); mainStack.Children.Add(_moonGrid); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_playerHandWPF); StackPanel finalStack = new StackPanel(); finalStack.Children.Add(firstInfo.GetContent); var button = GetGamingButton("Create New Moon", nameof(GalaxyCardGameMainViewModel.MoonAsync)); finalStack.Children.Add(endButton); finalStack.Children.Add(button); otherStack.Children.Add(finalStack); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_planetStack); otherStack.Children.Add(_score); mainStack.Children.Add(otherStack); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public OpetongMainView(IEventAggregator aggregator, TestOptions test, OpetongVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _mainG = new MainRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard>, RummySet, SavedSet>(); _poolG = new CardBoardWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(OpetongMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_poolG); _poolG.HorizontalAlignment = HorizontalAlignment.Left; _poolG.VerticalAlignment = VerticalAlignment.Top; _tempG.Height = 350; otherStack.Children.Add(_tempG); var button = GetGamingButton("Lay Down Single Set", nameof(OpetongMainViewModel.PlaySetAsync)); otherStack.Children.Add(button); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(OpetongPlayerItem.ObjectCount)); //very common. _score.AddColumn("Sets Played", true, nameof(OpetongPlayerItem.SetsPlayed)); _score.AddColumn("Score", true, nameof(OpetongPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(OpetongMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(OpetongMainViewModel.Status)); firstInfo.AddRow("Instructions", nameof(OpetongMainViewModel.Instructions)); StackPanel finalStack = new StackPanel(); finalStack.Children.Add(_score); finalStack.Children.Add(firstInfo.GetContent); otherStack.Children.Add(finalStack); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(_mainG); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public FourSuitRummyMainView(IEventAggregator aggregator, TestOptions test, FourSuitRummyVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _discardGPile = new BasePileWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(FourSuitRummyMainViewModel.RestoreScreen) }; } Grid finalGrid = new Grid(); AddLeftOverRow(finalGrid, 20); // has to be this way because of scoreboard. AddLeftOverRow(finalGrid, 80); mainStack.Children.Add(finalGrid); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. Grid firstGrid = new Grid(); AddLeftOverColumn(firstGrid, 60); // 50 was too much. if there is scrolling, i guess okay. AddLeftOverColumn(firstGrid, 10); // for buttons (can change if necessary) AddAutoColumns(firstGrid, 1); // maybe 1 (well see) AddLeftOverColumn(firstGrid, 15); // for other details AddLeftOverColumn(firstGrid, 30); // for scoreboard _deckGPile.HorizontalAlignment = HorizontalAlignment.Left; _deckGPile.VerticalAlignment = VerticalAlignment.Top; _discardGPile.HorizontalAlignment = HorizontalAlignment.Left; _discardGPile.VerticalAlignment = VerticalAlignment.Top; AddControlToGrid(firstGrid, otherStack, 0, 2); // i think AddControlToGrid(firstGrid, _playerHandWPF, 0, 0); // i think var thisBut = GetGamingButton("Play Sets", nameof(FourSuitRummyMainViewModel.PlaySetsAsync)); AddControlToGrid(firstGrid, thisBut, 0, 1); _score.AddColumn("Cards Left", true, nameof(FourSuitRummyPlayerItem.ObjectCount)); //very common. _score.AddColumn("Total Score", true, nameof(FourSuitRummyPlayerItem.TotalScore)); AddControlToGrid(firstGrid, _score, 0, 4); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(FourSuitRummyMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FourSuitRummyMainViewModel.Status)); AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 3); AddControlToGrid(finalGrid, firstGrid, 0, 0); // i think _tempG.Height = 700; StackPanel thirdStack = new StackPanel(); thirdStack.Orientation = Orientation.Horizontal; thirdStack.Children.Add(_tempG); Grid setGrid = new Grid(); AddLeftOverColumn(setGrid, 50); AddLeftOverColumn(setGrid, 50); AddPixelRow(setGrid, 700); // i think this one needs that. thirdStack.Children.Add(setGrid); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(FourSuitRummyMainViewModel.YourSetsScreen) }; AddControlToGrid(setGrid, parent, 0, 0); parent = new ParentSingleUIContainer() { Name = nameof(FourSuitRummyMainViewModel.OpponentSetsScreen) }; AddControlToGrid(setGrid, parent, 0, 1); AddControlToGrid(finalGrid, thirdStack, 1, 0); // i think _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
private void LoadSinglePlayer(GalaxyCardGamePlayerItem thisPlayer) { BaseHandWPF <GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> > thisPlanet = new BaseHandWPF <GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> >(); thisPlanet.LoadList(thisPlayer.PlanetHand !, ts.TagUsed); thisPlanet.Margin = new Thickness(5, 5, 5, 5); _planetStack !.Children.Add(thisPlanet); MainRummySetsWPF <EnumSuitList, EnumColorList, GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation>, MoonClass, SavedSet> thisMoon = new MainRummySetsWPF <EnumSuitList, EnumColorList, GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation>, MoonClass, SavedSet>(); thisMoon.Divider = 2; thisMoon.Init(thisPlayer.Moons !, ts.TagUsed); thisMoon.Margin = new Thickness(5, 5, 5, 5); thisMoon.HorizontalAlignment = HorizontalAlignment.Stretch; thisMoon.Height = 300; //bad news is on tablets, no source code to go by. AddControlToGrid(_moonGrid !, thisMoon, 0, _moonGrid !.Children.Count); //hopefully this works. }
public MonopolyCardGameMainView(IEventAggregator aggregator, TestOptions test, MonopolyCardGameVMData model, MonopolyCardGameGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <MonopolyCardGameCardInformation, MonopolyCardGameGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <MonopolyCardGameCardInformation, MonopolyCardGameGraphicsCP, CardGraphicsWPF>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(MonopolyCardGameMainViewModel.RestoreScreen) }; } mainStack.Children.Add(_cardDetail); Grid finalGrid = new Grid(); AddPixelColumn(finalGrid, 900); AddAutoColumns(finalGrid, 1); _tradeStack.Orientation = Orientation.Horizontal; AddControlToGrid(finalGrid, _tradeStack, 0, 1); AddControlToGrid(finalGrid, mainStack, 0, 0); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); StackPanel tempStack = new StackPanel(); var thisBut = GetGamingButton("Resume", nameof(MonopolyCardGameMainViewModel.ResumeAsync)); tempStack.Children.Add(thisBut); thisBut = GetGamingButton("Go Out", nameof(MonopolyCardGameMainViewModel.GoOutAsync)); tempStack.Children.Add(thisBut); otherStack.Children.Add(tempStack); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(MonopolyCardGamePlayerItem.ObjectCount)); //very common. _score.AddColumn("Previous Money", true, nameof(MonopolyCardGamePlayerItem.PreviousMoney), useCurrency: true); _score.AddColumn("Total Money", true, nameof(MonopolyCardGamePlayerItem.TotalMoney), useCurrency: true); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(MonopolyCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(MonopolyCardGameMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalGrid; }
public A8RoundRummyMainView(IEventAggregator aggregator, TestOptions test, A8RoundRummyVMData model, A8RoundRummyGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>(); _roundControl = new RoundUI(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(A8RoundRummyMainViewModel.RestoreScreen) }; } Grid grid2 = new Grid(); AddLeftOverColumn(grid2, 60); AddLeftOverColumn(grid2, 40); // can adjust as needed AddControlToGrid(grid2, mainStack, 0, 0); _roundControl = new RoundUI(); AddControlToGrid(grid2, _roundControl, 0, 1); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. var thisBut = GetGamingButton("Go Out", nameof(A8RoundRummyMainViewModel.GoOutAsync)); otherStack.Children.Add(thisBut); mainStack.Children.Add(_playerHandWPF); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(A8RoundRummyMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(A8RoundRummyMainViewModel.Status)); firstInfo.AddRow("Next", nameof(A8RoundRummyMainViewModel.NextTurn)); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(A8RoundRummyPlayerItem.ObjectCount)); //very common. _score.AddColumn("Total Score", true, nameof(A8RoundRummyPlayerItem.TotalScore)); mainStack.Children.Add(_score); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = grid2; }
public FiveCrownsMainView(IEventAggregator aggregator, TestOptions test, FiveCrownsVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _mainG = new MainRummySetsWPF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF, PhaseSet, SavedSet>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(FiveCrownsMainViewModel.RestoreScreen) }; } Grid finalGrid = new Grid(); AddLeftOverRow(finalGrid, 20); // has to be this way because of scoreboard. AddLeftOverRow(finalGrid, 80); mainStack.Children.Add(finalGrid); Grid firstGrid = new Grid(); AddLeftOverColumn(firstGrid, 40); // 50 was too much. if there is scrolling, i guess okay. AddLeftOverColumn(firstGrid, 10); // for buttons (can change if necessary) AddAutoColumns(firstGrid, 1); // maybe 1 (well see) AddLeftOverColumn(firstGrid, 15); // for other details AddLeftOverColumn(firstGrid, 30); // for scoreboard _deckGPile.HorizontalAlignment = HorizontalAlignment.Left; _deckGPile.VerticalAlignment = VerticalAlignment.Top; _discardGPile.HorizontalAlignment = HorizontalAlignment.Left; _discardGPile.VerticalAlignment = VerticalAlignment.Top; StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. AddControlToGrid(firstGrid, otherStack, 0, 2); // i think AddControlToGrid(firstGrid, _playerHandWPF, 0, 0); // i think var thisBut = GetGamingButton("Lay" + Constants.vbCrLf + "Down", nameof(FiveCrownsMainViewModel.LayDownSetsAsync)); StackPanel tempStack = new StackPanel(); tempStack.Orientation = Orientation.Horizontal; tempStack.Children.Add(thisBut); thisBut = GetGamingButton("Back", nameof(FiveCrownsMainViewModel.Back)); thisBut.FontSize -= 4; tempStack.Children.Add(thisBut); AddControlToGrid(firstGrid, tempStack, 0, 1); _score.AddColumn("Cards Left", true, nameof(FiveCrownsPlayerItem.ObjectCount)); //very common. _score.AddColumn("Current Score", true, nameof(FiveCrownsPlayerItem.CurrentScore)); _score.AddColumn("Total Score", true, nameof(FiveCrownsPlayerItem.TotalScore)); AddControlToGrid(firstGrid, _score, 0, 4); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(FiveCrownsMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FiveCrownsMainViewModel.Status)); firstInfo.AddRow("Up To", nameof(FiveCrownsMainViewModel.UpTo)); AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 3); AddControlToGrid(finalGrid, firstGrid, 0, 0); // i think _tempG.Height = 700; StackPanel thirdStack = new StackPanel(); thirdStack.Orientation = Orientation.Horizontal; thirdStack.Children.Add(_tempG); _mainG.Height = 700; // try this way. thirdStack.Children.Add(_mainG); AddControlToGrid(finalGrid, thirdStack, 1, 0); // i think _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public CribbageMainView(IEventAggregator aggregator, TestOptions test, CribbageVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _discardGPile = new BasePileWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _crib1 = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _main1 = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _otherScore = new ScoreUI(); _main1.Divider = 1.5; StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(CribbageMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. otherStack.Children.Add(_main1); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", false, nameof(CribbagePlayerItem.ObjectCount)); //very common. _score.AddColumn("Is Skunk Hole", false, nameof(CribbagePlayerItem.IsSkunk), useTrueFalse: true); _score.AddColumn("First Position", false, nameof(CribbagePlayerItem.FirstPosition)); _score.AddColumn("Second Position", false, nameof(CribbagePlayerItem.SecondPosition)); _score.AddColumn("Score Round", false, nameof(CribbagePlayerItem.ScoreRound)); _score.AddColumn("Total Score", false, nameof(CribbagePlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(CribbageMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(CribbageMainViewModel.Status)); firstInfo.AddRow("Dealer", nameof(CribbageMainViewModel.Dealer)); SimpleLabelGrid others = new SimpleLabelGrid(); others.AddRow("Count", nameof(CribbageMainViewModel.TotalCount)); mainStack.Children.Add(_playerHandWPF); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); var button = GetGamingButton("Continue", nameof(CribbageMainViewModel.ContinueAsync)); otherStack.Children.Add(button); button = GetGamingButton("To Crib", nameof(CribbageMainViewModel.CribAsync)); otherStack.Children.Add(button); button = GetGamingButton("Play", nameof(CribbageMainViewModel.PlayAsync)); otherStack.Children.Add(button); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); otherStack.Children.Add(firstInfo.GetContent); otherStack.Children.Add(_crib1); Grid finalGrid = new Grid(); AddPixelRow(finalGrid, 300); // hopefully this is enough AddLeftOverRow(finalGrid, 1); AddLeftOverColumn(finalGrid, 70); AddLeftOverColumn(finalGrid, 30); AddControlToGrid(finalGrid, mainStack, 0, 0); Grid.SetRowSpan(mainStack, 2); StackPanel finalStack = new StackPanel(); finalStack.Children.Add(others.GetContent); finalStack.Children.Add(_otherScore); AddControlToGrid(finalGrid, finalStack, 0, 1); AddControlToGrid(finalGrid, _score, 1, 1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalGrid; }
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); }
public MilkRunMainView(IEventAggregator aggregator, TestOptions test, MilkRunVMData model, MilkRunGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>(); _playerHandWPF = new BaseHandWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>(); _opponentChocolateDeliveries = new TextBlock(); _opponentStrawberryDeliveries = new TextBlock(); _opponentChocolatePiles = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>(); _opponentStrawberryPiles = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>(); _yourChocolateDeliveries = new TextBlock(); _yourStrawberryDeliveries = new TextBlock(); _yourChocolatePiles = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>(); _yourStrawberryPiles = new BasicMultiplePilesWPF <MilkRunCardInformation, MilkRunGraphicsCP, CardGraphicsWPF>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(MilkRunMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. AddPlayArea(otherStack); mainStack.Children.Add(otherStack); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(MilkRunMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(MilkRunMainViewModel.Status)); StackPanel newStack = new StackPanel(); mainStack.Children.Add(newStack); newStack.HorizontalAlignment = HorizontalAlignment.Center; newStack.Margin = new Thickness(0, 10, 0, 0); newStack.Children.Add(_playerHandWPF); newStack.Children.Add(firstInfo.GetContent); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public RookMainView(IEventAggregator aggregator, TestOptions test, RookVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RookCardInformation, RookGraphicsCP, CardGraphicsWPF>(); _trick1 = new SeveralPlayersTrickWPF <EnumColorTypes, RookCardInformation, RookGraphicsCP, CardGraphicsWPF, RookPlayerItem>(); _dummy1 = new BaseHandWPF <RookCardInformation, RookGraphicsCP, CardGraphicsWPF>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.NestScreen) }; mainStack.Children.Add(parent); _score.AddColumn("Bid Amount", true, nameof(RookPlayerItem.BidAmount)); _score.AddColumn("Tricks Won", false, nameof(RookPlayerItem.TricksWon)); _score.AddColumn("Current Score", false, nameof(RookPlayerItem.CurrentScore)); _score.AddColumn("Total Score", false, nameof(RookPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(RookMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(RookMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(RookMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(_dummy1); otherStack.Children.Add(_score); otherStack.Children.Add(firstInfo.GetContent); parent = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.BidScreen) }; otherStack.Children.Add(parent); parent = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.ColorScreen) }; otherStack.Children.Add(parent); otherStack.Children.Add(_trick1); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public FlinchMainView(IEventAggregator aggregator, TestOptions test, FlinchVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <FlinchCardInformation, FlinchGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <FlinchCardInformation, FlinchGraphicsCP, CardGraphicsWPF>(); _publicGraphics = new PublicPilesWPF(); _publicGraphics.Width = 700; _publicGraphics.Height = 500; StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(FlinchMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_publicGraphics); mainStack.Children.Add(otherStack); StackPanel tempStack = new StackPanel(); var thisLabel = GetDefaultLabel(); thisLabel.Text = "Cards To Reshuffle"; tempStack.Children.Add(thisLabel); otherStack.Children.Add(tempStack); thisLabel = GetDefaultLabel(); thisLabel.SetBinding(TextBlock.TextProperty, nameof(FlinchMainViewModel.CardsToShuffle)); tempStack.Children.Add(thisLabel); _score.AddColumn("In Stock", false, nameof(FlinchPlayerItem.InStock)); int x; for (x = 1; x <= 5; x++) //has to change for flinch. { var thisStr = "Discard" + x; _score.AddColumn(thisStr, false, thisStr); } _score.AddColumn("Stock Left", false, nameof(FlinchPlayerItem.StockLeft)); _score.AddColumn("Cards Left", false, nameof(FlinchPlayerItem.ObjectCount)); //very common. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(FlinchMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FlinchMainViewModel.Status)); otherStack.Children.Add(_score); Button endButton = GetGamingButton("End Turn", nameof(FlinchMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; endButton.VerticalAlignment = VerticalAlignment.Top; otherStack.Children.Add(endButton); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_playerHandWPF); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(FlinchMainViewModel.PlayerPilesScreen) }; mainStack.Children.Add(parent); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public BladesOfSteelMainView(IEventAggregator aggregator, TestOptions test, BladesOfSteelVMData model, BladesOfSteelGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _discardGPile = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _mainDefenseCards = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _opponentDefense = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _opponentAttack = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _yourDefense = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _yourAttack = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); ScoringGuideWPF tempScore = new ScoringGuideWPF(); _score.AddColumn("Cards Left", true, nameof(BladesOfSteelPlayerItem.ObjectCount), rightMargin: 5); _score.AddColumn("Score", true, nameof(BladesOfSteelPlayerItem.Score), rightMargin: 5); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(BladesOfSteelMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(tempScore); otherStack.Children.Add(_score); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); StackPanel firstStack = new StackPanel(); AddVerticalLabelGroup("Instructions", nameof(BladesOfSteelMainViewModel.Instructions), firstStack); otherStack.Children.Add(firstStack); Grid playerArea = new Grid(); AddAutoColumns(playerArea, 3); AddAutoRows(playerArea, 2); _opponentDefense.Margin = new Thickness(0, 0, 0, 20); AddControlToGrid(playerArea, _opponentDefense, 0, 2); AddControlToGrid(playerArea, _opponentAttack, 0, 1); _opponentAttack.Margin = new Thickness(0, 0, 0, 20); AddControlToGrid(playerArea, _mainDefenseCards, 1, 0); AddControlToGrid(playerArea, _yourAttack, 1, 1); AddControlToGrid(playerArea, _yourDefense, 1, 2); mainStack.Children.Add(playerArea); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); AddControlToGrid(playerArea, otherStack, 0, 0); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); var endButton = GetGamingButton("End Turn", nameof(BladesOfSteelMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; endButton.VerticalAlignment = VerticalAlignment.Center; otherStack.Children.Add(endButton); var otherBut = GetGamingButton("Pass", nameof(BladesOfSteelMainViewModel.PassAsync)); otherStack.Children.Add(otherBut); otherBut.HorizontalAlignment = HorizontalAlignment.Left; otherBut.VerticalAlignment = VerticalAlignment.Center; otherStack.Children.Add(_playerHandWPF); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); _deckGPile.HorizontalAlignment = HorizontalAlignment.Left; _deckGPile.VerticalAlignment = VerticalAlignment.Top; _discardGPile.HorizontalAlignment = HorizontalAlignment.Left; _discardGPile.VerticalAlignment = VerticalAlignment.Top; if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } _score !.LoadLists(gameContainer.PlayerList !); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think _discardGPile !.Init(_model.Pile1 !, ts.TagUsed); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ts.TagUsed); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _mainDefenseCards !.LoadList(_model.MainDefense1 !, ts.TagUsed); _yourAttack !.LoadList(_model.YourAttackPile !, ts.TagUsed); _yourDefense !.LoadList(_model.YourDefensePile !, ts.TagUsed); _opponentAttack !.LoadList(_model.OpponentAttackPile !, ts.TagUsed); _opponentDefense !.LoadList(_model.OpponentDefensePile !, ts.TagUsed); Content = mainStack; }
public YahtzeeHandsDownMainView(IEventAggregator aggregator, TestOptions test, YahtzeeHandsDownVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>(); _combo1 = new ComboHandWPF(); _chance1 = new ChanceSinglePileWPF(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(YahtzeeHandsDownMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. _chance1.Margin = new Thickness(5, 5, 5, 5); _chance1.HorizontalAlignment = HorizontalAlignment.Left; _chance1.VerticalAlignment = VerticalAlignment.Top; otherStack.Children.Add(_chance1); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(YahtzeeHandsDownPlayerItem.ObjectCount)); //very common. _score.AddColumn("Total Score", true, nameof(YahtzeeHandsDownPlayerItem.TotalScore)); _score.AddColumn("Won Last Round", true, nameof(YahtzeeHandsDownPlayerItem.WonLastRound)); _score.AddColumn("Score Round", true, nameof(YahtzeeHandsDownPlayerItem.ScoreRound)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(YahtzeeHandsDownMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(YahtzeeHandsDownMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); var otherButton = GetGamingButton("Go Out", nameof(YahtzeeHandsDownMainViewModel.GoOutAsync)); mainStack.Children.Add(otherButton); var endButton = GetGamingButton("End Turn", nameof(YahtzeeHandsDownMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; mainStack.Children.Add(endButton); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(mainStack); _combo1.HandType = HandObservable <ComboCardInfo> .EnumHandList.Vertical; otherStack.Children.Add(_combo1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { //todo: figure out where to place the restore ui if there is a restore option. mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = otherStack; }
public LifeCardGameMainView(IEventAggregator aggregator, TestOptions test, LifeCardGameVMData model, LifeCardGameGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); _storyStack.Orientation = Orientation.Horizontal; _currentCard = new BasePileWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(LifeCardGameMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. otherStack.Children.Add(_currentCard); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); Button button; button = GetGamingButton("Years Passed", nameof(LifeCardGameMainViewModel.YearsPassedAsync)); otherStack.Children.Add(button); button = GetGamingButton("Play Card", nameof(LifeCardGameMainViewModel.PlayCardAsync)); otherStack.Children.Add(button); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(LifeCardGameMainViewModel.OtherScreen), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top }; otherStack.Children.Add(parent); _score.AddColumn("Cards Left", true, nameof(LifeCardGamePlayerItem.ObjectCount)); //very common. _score.AddColumn("Points", true, nameof(LifeCardGamePlayerItem.Points)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(LifeCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(LifeCardGameMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_score); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(otherStack); StackPanel finalStack = new StackPanel(); finalStack.Orientation = Orientation.Horizontal; finalStack.Children.Add(mainStack); finalStack.Children.Add(_storyStack); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); _currentCard.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalStack; }