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

            _mainPile.Init(model.Main1, ts.TagUsed);
            _wastePile.Init(model);

            return(Task.CompletedTask);
        }
        public void Init(HeapSolitaireMainViewModel thisMod, BasicPileInfo <HeapSolitaireCardInfo> thisPile)
        {
            _mainMod    = thisMod.Waste1;
            _privateMod = thisPile;
            _cardList   = _privateMod.ObjectList;
            var tempDeck = GetNewCard(new HeapSolitaireCardInfo());

            _pixels = (int)tempDeck.ObjectSize.Width / 4;
            _cardList.CollectionChanged += CollectionChanged;
            Background = Brushes.Transparent; //learned from old version of belegured castle that if not set to transparent, clicking does not work.
            MouseUp   += SinglePileUI_MouseUp;
            _privateMod.PropertyChanged += PropertyChanged;
            _thisGrid = new Grid();
            Content   = _thisGrid;
            PopulateControls();
        }
Example #3
0
        public void Init(HeapSolitaireMainViewModel thisMod)
        {
            Grid thisGrid = new Grid();
            var  tempMod  = thisMod.Waste1;

            if (tempMod !.PileList !.Count != 23)
            {
                throw new BasicBlankException("Needed to have 23 piles");
            }
            AddAutoRows(thisGrid, 5);
            AddAutoColumns(thisGrid, 5);
            tempMod.PileList.ForEach(thisPile =>
            {
                SinglePileUI thisSingle = new SinglePileUI();
                thisSingle.Margin       = new Thickness(0, 0, 20, 20);
                thisSingle.Init(thisMod, thisPile);
                AddControlToGrid(thisGrid, thisSingle, thisPile.Row - 1, thisPile.Column - 1);
            });
            Content = thisGrid;
        }
        public void Init(HeapSolitaireMainViewModel thisMod, BasicPileInfo <HeapSolitaireCardInfo> thisPile)
        {
            _mainMod    = thisMod.Waste1;
            _privateMod = thisPile;
            _cardList   = _privateMod.ObjectList;
            var tempDeck = GetNewCard(new HeapSolitaireCardInfo());

            _pixels = (int)tempDeck.ObjectSize.Width / 4;
            _cardList.CollectionChanged += CollectionChanged;
            _canvas = new SKCanvasView();
            _canvas.EnableTouchEvents = true;
            _canvas.Touch            += Touch;
            Grid grid = new Grid();

            _privateMod.PropertyChanged += TempPropertyChanged;
            _thisGrid = new Grid();
            _thisGrid.InputTransparent = true;
            grid.Children.Add(_thisGrid);
            grid.Children.Add(_canvas);
            Content = grid;
            PopulateControls();
        }
 public Task NewGameAsync(HeapSolitaireMainViewModel model)
 {
     GameGoing = true;
     _model    = model;
     return(base.NewGameAsync(model.DeckPile));
 }