Table of Contents

Class DockPanel

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

A panel which arranges its children at the top, bottom, left, right or center.

public class DockPanel : Panel, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider
Inheritance
DockPanel
Implements
Inherited Members
Extension Methods

Constructors

DockPanel()

public DockPanel()

Fields

DockProperty

Defines the Dock attached property.

public static readonly AttachedProperty<Dock> DockProperty

Field Value

AttachedProperty<Dock>

HorizontalSpacingProperty

Identifies the HorizontalSpacing dependency property.

public static readonly StyledProperty<double> HorizontalSpacingProperty

Field Value

StyledProperty<double>

The identifier for the HorizontalSpacing dependency property.

LastChildFillProperty

Defines the LastChildFill property.

public static readonly StyledProperty<bool> LastChildFillProperty

Field Value

StyledProperty<bool>

VerticalSpacingProperty

Identifies the VerticalSpacing dependency property.

public static readonly StyledProperty<double> VerticalSpacingProperty

Field Value

StyledProperty<double>

The identifier for the VerticalSpacing dependency property.

Properties

HorizontalSpacing

Gets or sets the horizontal distance between the child objects.

public double HorizontalSpacing { get; set; }

Property Value

double

LastChildFill

Gets or sets a value which indicates whether the last child of the DockPanel fills the remaining space in the panel.

public bool LastChildFill { get; set; }

Property Value

bool

VerticalSpacing

Gets or sets the vertical distance between the child objects.

public double VerticalSpacing { get; set; }

Property Value

double

Methods

ArrangeOverride(Size)

DockPanel computes a position and final size for each of its children based upon their Dock enum and sizing properties.

protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize Size

Size that DockPanel will assume to position children.

Returns

Size

GetDock(Control)

Gets the value of the Dock attached property on the specified control.

public static Dock GetDock(Control control)

Parameters

control Control

The control.

Returns

Dock

The Dock attached property.

MeasureOverride(Size)

Updates DesiredSize of the DockPanel. Called by parent Control. This is the first pass of layout.

protected override Size MeasureOverride(Size availableSize)

Parameters

availableSize Size

Constraint size is an "upper limit" that the return value should not exceed.

Returns

Size

The Panel's desired size.

Remarks

Children are measured based on their sizing properties and Dock.
Each child is allowed to consume all the space on the side on which it is docked; Left/Right docked children are granted all vertical space for their entire width, and Top/Bottom docked children are granted all horizontal space for their entire height.

SetDock(Control, Dock)

Sets the value of the Dock attached property on the specified control.

public static void SetDock(Control control, Dock value)

Parameters

control Control

The control.

value Dock

The value of the Dock property.