Exemple #1
0
        public ClockSolitaireMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);
            _clock = new MainClockXF();

            Grid grid = new Grid();

            SimpleLabelGridXF label = new SimpleLabelGridXF();

            label.AddRow("Cards", nameof(ClockSolitaireMainViewModel.CardsLeft));

            grid.Children.Add(label.GetContent);
            _clock.Margin = new Thickness(5, 10, 0, 0);
            grid.Children.Add(_clock);
            Content = grid;
        }
Exemple #2
0
        public GrandfathersClockMainView(IEventAggregator aggregator)
        {
            _aggregator = aggregator;
            _aggregator.Subscribe(this);

            StackLayout stack      = new StackLayout();
            StackLayout otherStack = new StackLayout();

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

            autoBut.HorizontalOptions = LayoutOptions.Start;
            autoBut.VerticalOptions   = LayoutOptions.Start;
            var scoresAlone = new SimpleLabelGridXF();

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

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

            thisClock.Margin = new Thickness(0, 60, 0, 0);
            _clock           = thisClock;
            Grid thisGrid = new Grid();

            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;
        }