Skip to content

Panel class

Base class for layout panels that contain multiple children.

Guide: C# Markup reference: Panel

public abstract class Panel : FrameworkElement, ILogicalTreeHost, IVisualTreeHost
name description
Children { get; } Gets the collection of child elements.
ClipToBounds { get; set; } Gets or sets whether children are clipped to the panel bounds.
Count { get; } Gets the number of children.
Item { get; } Gets the child at the specified index.
Padding { get; set; } Gets or sets the inner padding between the panel bounds and its children.
Add(…) Adds a child element to the end of the panel, transferring it from its current owner if it has one.
AddRange(…) Adds multiple children to the panel.
Clear() Removes all children from the panel.
Insert(…) Inserts a child at the specified index, transferring it from its current owner if it has one.
Remove(…) Removes a child element from the panel; returns false when it was not a child.
RemoveAt(…) Removes the child at the specified index.
static readonly ClipToBoundsProperty Whether children are clipped to the panel bounds.
static readonly PaddingProperty The inner padding between the panel bounds and its children.