public void Init(PublicViewModel mod) { _thisMod = mod; _thisStack = new StackLayout(); var tempCard = new DutchBlitzCardInformation(); var thisP = Resolve <IProportionImage>(); HeightRequest = tempCard.DefaultSize.Height * thisP.Proportion; _thisStack.Orientation = StackOrientation.Horizontal; // start out horizontally _thisStack.HorizontalOptions = LayoutOptions.Start; _thisStack.VerticalOptions = LayoutOptions.Start; Grid grid = new Grid(); _drawControl = new SKCanvasView(); _drawControl.EnableTouchEvents = true; _drawControl.Touch += TouchEvent; _pileList = _thisMod.PileList; // i think its that simple. _pileList.CollectionChanged += PileList_CollectionChanged; foreach (var thisPile in _pileList) { IndividualPileXF thisCon = new IndividualPileXF(); thisCon.ThisPile = thisPile; thisCon.MainMod = _thisMod; thisCon.Init(); // i think i needed this as well _thisStack.Children.Add(thisCon); } grid.Children.Add(_drawControl); grid.Children.Add(_thisStack); Content = grid; }
public void Init(PublicViewModel mod) { Background = Brushes.Transparent; _thisMod = mod; _thisStack = new WrapPanel(); var tempCard = new DutchBlitzCardInformation(); var thisP = Resolve <IProportionImage>(); _thisStack.ItemHeight = tempCard.DefaultSize.Height * thisP.Proportion; _thisStack.ItemWidth = tempCard.DefaultSize.Width * thisP.Proportion; _thisStack.Orientation = Orientation.Horizontal; // start out horizontally MouseUp += PublicPilesWPF_MouseUp; _pileList = _thisMod.PileList; // i think its that simple. _pileList.CollectionChanged += PileList_CollectionChanged; foreach (var thisPile in _pileList) { IndividualPileWPF thisCon = new IndividualPileWPF(); thisCon.IsHitTestVisible = true; thisCon.ThisPile = thisPile; thisCon.MainMod = _thisMod; thisCon.Init(); // i think i needed this as well _thisStack.Children.Add(thisCon); } Content = _thisStack; }