private IndividualSolitairePileWPF?FindControl(PileInfoCP thisPile) { foreach (var firstControl in _thisStack !.Children) { var thisGraphics = firstControl as IndividualSolitairePileWPF; if (thisGraphics !.DataContext.Equals(thisPile)) { return(thisGraphics); } } return(null); //you can have null this time. }
public void Init(PileInfoCP singlePile, SolitairePilesCP main) { MouseUp += SinglePileUI_MouseUp; _mainMod = main; _thisMod = singlePile; _thisMod.PropertyChanged += PropertyChanged; _cardList = singlePile.CardList; _cardList.CollectionChanged += CollectionChanged; Background = Brushes.Transparent; //this was required too. _thisGrid = new Grid(); Content = _thisGrid; var tempCard = GetNewCard(new SolitaireCard()); _widthUsed = tempCard.ObjectSize.Width; //needs this so we know. PopulateControls(); }
public void Init(PileInfoCP singlePile, SolitairePilesCP main) { Grid otherGrid = new Grid(); _mainMod = main; _thisMod = singlePile; //hopefully property change just works right (?) _thisMod.PropertyChanged += SinglePileUI_PropertyChanged; _cardList = singlePile.CardList; _cardList.CollectionChanged += CollectionChanged; _thisGrid = new Grid(); _thisGrid.InputTransparent = true; otherGrid.Children.Add(_thisGrid); _thisControl = new SKCanvasView(); _thisControl.EnableTouchEvents = true; _thisControl.Touch += TouchEvent; otherGrid.Children.Add(_thisControl); Content = otherGrid; var tempCard = GetNewCard(new SolitaireCard()); _widthUsed = tempCard.ObjectSize.Width; //needs this so we know. PopulateControls(); }