private void PopulateList() { _thisStack !.Children.Clear(); foreach (var thisShape in _shapeList !) { XactikaPieceXF thisGraphics = new XactikaPieceXF(); PieceBindings(thisGraphics, thisShape); _thisStack.Children.Add(thisGraphics); } }
private void PieceBindings(XactikaPieceXF thisGraphics, PieceCP thisPiece) { thisGraphics.WidthRequest = _sizeUsed.Width; thisGraphics.HeightRequest = _sizeUsed.Height; thisGraphics.Margin = new Thickness(5, 0, 5, 5); // i do like the idea of margins this time as well. thisGraphics.IsVisible = true; // has to manually be set thisGraphics.BindingContext = thisPiece; var thisBind = GetCommandBinding(nameof(ChooseShapeObservable.ShapeSelectedCommand)); thisGraphics.SetBinding(GraphicsCommand.CommandProperty, thisBind); thisGraphics.CommandParameter = thisPiece; // i think thisGraphics.SetBinding(XactikaPieceXF.ShapeUsedProperty, nameof(PieceCP.ShapeUsed)); thisGraphics.SetBinding(XactikaPieceXF.HowManyProperty, nameof(PieceCP.HowMany)); thisGraphics.SetBinding(XactikaPieceXF.IsSelectedProperty, nameof(PieceCP.IsSelected)); thisGraphics.SetBinding(IsEnabledProperty, nameof(PieceCP.IsEnabled)); thisGraphics.SendPiece(thisPiece); // i think }