Class Panel
Base class for controls that can contain multiple children.
public class Panel : Control, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider
- Inheritance
-
Panel
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
Controls can be added to a Panel by adding them to its Children collection. All children are layed out to fill the panel.
Constructors
Panel()
Initializes a new instance of the Panel class.
public Panel()
Fields
BackgroundProperty
Defines the Background property.
public static readonly StyledProperty<IBrush?> BackgroundProperty
Field Value
Properties
Background
Gets or Sets Panel background brush.
public IBrush? Background { get; set; }
Property Value
Children
Gets the children of the Panel.
[Content]
public Controls Children { get; }
Property Value
IsItemsHost
Gets whether the Panel hosts the items created by an ItemsPresenter.
public bool IsItemsHost { get; }
Property Value
Methods
AffectsParentArrange<TPanel>(params AvaloniaProperty[])
Marks a property on a child as affecting the parent panel's arrangement.
protected static void AffectsParentArrange<TPanel>(params AvaloniaProperty[] properties) where TPanel : Panel
Parameters
properties
AvaloniaProperty[]The properties.
Type Parameters
TPanel
AffectsParentMeasure<TPanel>(params AvaloniaProperty[])
Marks a property on a child as affecting the parent panel's measurement.
protected static void AffectsParentMeasure<TPanel>(params AvaloniaProperty[] properties) where TPanel : Panel
Parameters
properties
AvaloniaProperty[]The properties.
Type Parameters
TPanel
ChildrenChanged(object?, NotifyCollectionChangedEventArgs)
Called when the Children collection changes.
protected virtual void ChildrenChanged(object? sender, NotifyCollectionChangedEventArgs e)
Parameters
sender
objectThe event sender.
e
NotifyCollectionChangedEventArgsThe event args.
Render(DrawingContext)
Renders the visual to a DrawingContext.
public override sealed void Render(DrawingContext context)
Parameters
context
DrawingContextThe drawing context.