Defines an area where you can arrange child elements either horizontally or vertically, relative to each other.
public class DockPanel : System.Windows.Controls.Panel
The SetDock method changes the position of an element relative to other elements within the same container. Alignment properties, such as HorizontalAlignment, change the position of an element relative to its parent element.
If you set the LastChildFill property to
true, which is the default setting, the last child element of a DockPanel always fills the remaining space, regardless of any other dock value that you set on the last child element. To dock a child element in another direction, you must set the LastChildFill property to
false and must also specify an explicit dock direction for the last child element.
Panel elements do not receive focus by default. To compel a panel element to receive focus, set the Focusable property to
Note: The position of child elements of a DockPanel on the screen is determined by the Dock property of the respective child elements and the relative order of those child elements under the DockPanel. Therefore, a set of child elements with the same Dock property values can be positioned differently on the screen depending on the order of these children under the DockPanel. Child ordering effects positioning because the DockPanel iterates through its child elements in order, setting the position of each element depending on remaining space.
Initializes a new instance of the DockPanel class.
Identifies the System.Windows.Controls.DockPanel.Dock attached property.
Identifies the LastChildFill dependency property.
Gets or sets a value that indicates whether the last child element within a DockPanel stretches to fill the remaining available space.
Arranges the content (child elements) of a DockPanel element.
Gets the value of the System.Windows.Controls.DockPanel.Dock attached property for a specified UIElement.
Sets the value of the System.Windows.Controls.DockPanel.Dock attached property to a specified element.