Share via


Dock panel

This page applies to WPF projects only

A dock panel in a Windows Presentation Foundation project provides a layout area within which you can arrange child elements around the edge of the screen based on compass direction: North, South, East, and West. The dock panel was historically used for root layout in other forms packages, because it allows panels to be docked around the edge of the screen.

When you add child elements to a dock panel, the elements are docked to the left part of the panel by default. The last child element that you add can fill the remaining space in the panel if the LastChildFill property for that element is set to True. By default, this property is set to False. When elements fill up the panel, they are then clipped or hidden by the parent layout container.

If you drag a child element of a dock panel on the artboard, notice that a large four-way cursor shows the directions that you can dock the element (see image below). You can use this four-way cursor as an alternative way to change dock orientation. Simply drag the element over the direction arrow that you want. Notice that the direction arrow that you select becomes highlighted, to indicate that you can drop the element to dock it in that direction.

Add a dock panel to a document by using the Asset LibraryCc295378.0224cabd-5da1-4e01-bddd-4a647401a098(en-us,Expression.10).png or the layout container button in the Toolbox. For more about how to work with dock panels, see the related topics, Change the docking order and Change the dock orientation.

Cc295378.72d46b58-9a49-4dd5-8af7-6843c0440226(en-us,Expression.10).png