Class Panel
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Element with children, an optional background/border and padding. Base class of every layout container.
public class Panel : UIElement
- Inheritance
-
Panel
- Derived
- Inherited Members
Remarks
The default layout stacks every child over the whole content area (like a single-cell grid). Derive and override MeasureOverride(Size) / ArrangeOverride(Rect) to implement a custom layout (see StackPanel for a short example).
Constructors
Panel()
Creates an empty panel.
public Panel()
Properties
Background
Background fill (null = transparent).
public Paint? Background { get; set; }
Property Value
BorderColor
Border color (transparent = none).
public Color BorderColor { get; set; }
Property Value
BorderThickness
Border thickness in DIPs.
public float BorderThickness { get; set; }
Property Value
Children
Children, drawn in order (last = topmost).
public ElementCollection Children { get; }
Property Value
ContentBounds
Content area (bounds minus padding).
protected Rect ContentBounds { get; }
Property Value
CornerRadius
Corner radius of the background and border.
public float CornerRadius { get; set; }
Property Value
Padding
Inner spacing between the border and the children.
public Thickness Padding { get; set; }
Property Value
ShadowBlur
Drop shadow blur radius.
public float ShadowBlur { get; set; }
Property Value
ShadowColor
Drop shadow color (transparent = none).
public Color ShadowColor { get; set; }
Property Value
ShadowOffset
Drop shadow offset.
public Point ShadowOffset { get; set; }
Property Value
VisualChildren
Child elements in drawing order (back to front).
public override IReadOnlyList<UIElement> VisualChildren { get; }
Property Value
Methods
Add(params UIElement[])
Adds children (fluent).
public Panel Add(params UIElement[] elements)
Parameters
elementsUIElement[]
Returns
ArrangeOverride(Rect)
Arranges children inside the final bounds.
protected override void ArrangeOverride(Rect bounds)
Parameters
boundsRect
MeasureOverride(Size)
Natural size of the content for the available size (margins excluded).
protected override Size MeasureOverride(Size available)
Parameters
availableSize
Returns
OnRender(DrawingContext)
Draws the element (below its children).
protected override void OnRender(DrawingContext dc)