Panel Class
NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls
Base class for controls that arrange a collection of child elements.
public class Panel : UIElement
Properties
Children
public UIElementCollection Children { get; }
The collection of child elements contained in this panel.
Background
public Media.Brush Background { get; set; }
The brush used to paint the panel's background, matching WPF's Panel.Background (Canvas/Grid/StackPanel/DockPanel). Null (the default) leaves the panel transparent, so whatever is behind it shows through.
CornerRadius
public int CornerRadius { get; set; }
Corner radius in pixels for the panel background (0 = square, the default). Cheap — only the corner pixels rasterize.
Methods
OnRender(Media.DrawingContext dc)
public override void OnRender(Media.DrawingContext dc)
Paints the background across the panel's render area (WPF Panel parity).
MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)
protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)
Measures the panel as the bounding size of all its children.