コード例 #1
0
        public MarthaSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);



            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            var autoBut     = GetGamingButton("Auto Make Move", nameof(MarthaSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(MarthaSolitaireMainViewModel.Score));
            var tempGrid = scoresAlone.GetContent;

            _waste = new SolitairePilesWPF();


            otherStack.Children.Add(_main);
            StackPanel tempStack = new StackPanel();

            otherStack.Children.Add(tempStack);
            stack.Children.Add(otherStack);

            tempStack.Children.Add(tempGrid);
            tempStack.Children.Add(autoBut);
            stack.Children.Add(_waste);

            Content = stack; //if not doing this, rethink.
        }
コード例 #2
0
        public KlondikeSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            var autoBut = GetGamingButton("Auto Make Move", nameof(KlondikeSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(KlondikeSolitaireMainViewModel.Score));
            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesWPF();
            //not sure where to place
            //needs to init.  however, needs a waste viewmodel to hook to.  the interface does not require to necessarily use it.
            //sometimes its more discard piles.
            var miscDiscard = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();

            //if this is being used, then needs to hook to a viewmodel that is associated with this one.
            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            otherStack.Children.Add(_main);
            stack.Children.Add(otherStack);
            stack.Children.Add(_waste);
            Grid grid = new Grid();

            AddAutoColumns(grid, 2);
            grid.Children.Add(stack);
            stack = new StackPanel();
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            AddControlToGrid(grid, stack, 0, 1);
            Content = grid;
        }
コード例 #3
0
        public VegasSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            var autoBut     = GetGamingButton("Auto Make Move", nameof(VegasSolitaireMainViewModel.AutoMoveAsync));
            var scoresAlone = new SimpleLabelGrid();
            var thisCon     = new CurrencyConverter();

            scoresAlone.AddRow("Money", nameof(VegasSolitaireMainViewModel.Money), thisCon);
            var tempGrid = scoresAlone.GetContent;

            _waste = new SolitairePilesWPF();

            otherStack.Children.Add(_main);
            stack.Children.Add(otherStack);
            stack.Children.Add(_waste);
            Grid grid = new Grid();

            AddAutoColumns(grid, 2);
            AddControlToGrid(grid, stack, 0, 0);

            _deckGPile.Margin    = new Thickness(5, 5, 5, 5);
            _discardGPile.Margin = new Thickness(5, 5, 5, 5);

            stack        = new StackPanel();
            stack.Margin = new Thickness(20, 5, 5, 5);
            AddControlToGrid(grid, stack, 0, 1);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);

            Content = grid; //if not doing this, rethink.
        }
        public AlternationSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            otherStack.Children.Add(_deckGPile);
            otherStack.Children.Add(_discardGPile);
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(100, 5, 5, 5);
            stack.Children.Add(otherStack);
            var autoBut = GetGamingButton("Auto Make Move", nameof(AlternationSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(AlternationSolitaireMainViewModel.Score));
            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesWPF();

            StackPanel tempStack = new StackPanel();

            otherStack.Children.Add(tempStack);
            tempStack.Children.Add(tempGrid);
            tempStack.Children.Add(autoBut);
            otherStack             = new StackPanel();
            otherStack.Orientation = Orientation.Horizontal;
            stack.Children.Add(otherStack);
            otherStack.Children.Add(_waste);
            otherStack.Children.Add(_main);


            Content = stack; //if not doing this, rethink.
        }
コード例 #5
0
        public DemonSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;


            _discardGPile        = new BasePileWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _discardGPile.Margin = new Thickness(5);
            _discardGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _discardGPile.VerticalAlignment   = VerticalAlignment.Top;


            StackPanel stack = new StackPanel();

            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(DemonSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Starting Number", nameof(DemonSolitaireMainViewModel.StartingNumber));
            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesWPF();

            _heel.HorizontalAlignment = HorizontalAlignment.Left;
            _heel.VerticalAlignment   = VerticalAlignment.Top;
            Grid grid = new Grid();

            AddAutoColumns(grid, 3);
            AddAutoRows(grid, 2);
            AddControlToGrid(grid, _deckGPile, 0, 0);
            AddControlToGrid(grid, _discardGPile, 0, 1);
            AddControlToGrid(grid, _main, 0, 2);
            AddControlToGrid(grid, _heel, 1, 1);
            AddControlToGrid(grid, _waste, 1, 2);
            stack.Children.Add(tempGrid);
            AddControlToGrid(grid, stack, 1, 0);
            _heel.Margin  = new Thickness(0, 5, 0, 0);
            _waste.Margin = new Thickness(0, 25, 0, 0);
            stack.Margin  = new Thickness(0, 5, 5, 0);
            Content       = grid;
        }
        public BakersDozenSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            stack.Children.Add(otherStack);

            var autoBut = GetGamingButton("Auto Make Move", nameof(BakersDozenSolitaireMainViewModel.AutoMoveAsync));

            autoBut.HorizontalAlignment = HorizontalAlignment.Left;

            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(BakersDozenSolitaireMainViewModel.Score));
            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesWPF();

            StackPanel finalStack = new StackPanel();

            otherStack.Children.Add(finalStack);
            otherStack.Children.Add(_main);
            finalStack.Children.Add(tempGrid);
            finalStack.Children.Add(autoBut);
            stack.Children.Add(_waste);

            //not sure where to place
            //needs to init.  however, needs a waste viewmodel to hook to.  the interface does not require to necessarily use it.
            //sometimes its more discard piles.
            var miscDiscard = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();

            //if this is being used, then needs to hook to a viewmodel that is associated with this one.


            Content = stack; //if not doing this, rethink.
        }
コード例 #7
0
        public GrandfathersClockMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            var autoBut = GetGamingButton("Auto Make Move", nameof(GrandfathersClockMainViewModel.AutoMoveAsync));

            autoBut.HorizontalAlignment = HorizontalAlignment.Left;
            autoBut.VerticalAlignment   = VerticalAlignment.Top;

            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(GrandfathersClockMainViewModel.Score));
            var tempGrid  = scoresAlone.GetContent;
            var thisWaste = new SolitairePilesWPF();

            _piles = thisWaste;
            var thisClock = new MainClockWPF();

            _clock = thisClock;
            Grid thisGrid = new Grid();

            thisGrid.Width = 800;
            otherStack.Children.Add(thisGrid);
            otherStack.Children.Add(thisWaste);
            otherStack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            thisGrid.Children.Add(stack);
            thisGrid.Children.Add(thisClock);
            Content = otherStack;
        }
コード例 #8
0
        public SpiderSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _deckGPile        = new BaseDeckWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            _deckGPile.HorizontalAlignment = HorizontalAlignment.Left;
            _deckGPile.VerticalAlignment   = VerticalAlignment.Top;

            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(2, 50, 5, 5);
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(SpiderSolitaireMainViewModel.Score));
            var tempGrid = scoresAlone.GetContent;

            _waste            = new SolitairePilesWPF();
            _deckGPile.Margin = new Thickness(5, 5, 5, 5);
            stack.Margin      = new Thickness(10, 5, 0, 0);
            otherStack.Children.Add(_waste);
            stack.Children.Add(tempGrid);
            stack.Children.Add(_deckGPile);
            otherStack.Children.Add(stack);
            stack = new StackPanel();
            Button ends = GetGamingButton("End Game", nameof(SpiderSolitaireMainViewModel.EndGameAsync));

            stack.Children.Add(ends);
            stack.Children.Add(_main);
            otherStack.Children.Add(stack);

            Content = otherStack; //if not doing this, rethink.
        }
コード例 #9
0
        public PersianSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);


            StackPanel stack = new StackPanel();

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _main        = new BasicMultiplePilesWPF <SolitaireCard, ts, DeckOfCardsWPF <SolitaireCard> >();
            _main.Margin = new Thickness(10, 5, 5, 5);
            var autoBut = GetGamingButton("Auto Make Move", nameof(PersianSolitaireMainViewModel.AutoMoveAsync));
            //not sure where to place it.
            //it probably varies from game to game.
            var scoresAlone = new SimpleLabelGrid();

            scoresAlone.AddRow("Score", nameof(PersianSolitaireMainViewModel.Score));
            scoresAlone.AddRow("Deal", nameof(PersianSolitaireMainViewModel.DealNumber));
            var finalButton = GetGamingButton("New Deal", nameof(PersianSolitaireMainViewModel.NewDeal));

            var tempGrid = scoresAlone.GetContent;

            //not sure where to place.
            _waste = new SolitairePilesWPF();
            otherStack.Children.Add(_waste);
            otherStack.Children.Add(_main);
            stack.Children.Add(tempGrid);
            stack.Children.Add(autoBut);
            stack.Children.Add(finalButton);
            otherStack.Children.Add(stack);



            Content = otherStack; //if not doing this, rethink.
        }