Dock Layout Control
- 2 minutes to read
DockLayoutControl - Arranging items
The DockLayoutControl is an item container that supports the docking functionality. The child items can be docked to the left, top, right or bottom edge or occupy the control's remaining region.
The following image shows a DockLayoutControl with six items docked to the control:
To specify how an item is docked, use the DockLayoutControl.Dock attached property. If an item is docked to a specific edge, it's positioned along this edge within an area not occupied by other items. So, the way items are docked depends on the order in which the items are docked (the order in which the items are listed in the container's Children collection). In the image above, the items are docked in the following order:
- Item 1 is docked to the top
- Item 2 is docked to the right
- Item 3 is docked to the bottom
- Item 4 is docked to the left
- Item 5 is docked to the top
- Item 6 is docked so that it occupies the remaining space
You can enable runtime resizing for individual items within a DockLayoutControl. This can be accomplished by using the DockLayoutControl.AllowHorizontalSizing and DockLayoutControl.AllowVerticalSizing attached properties. When resizing is enabled for an item, a sizer is displayed next to the item.
It's possible to temporarily disable item resizing via the DockLayoutControl.AllowItemSizing property.