DockPanel


DockPanelHierarchy: UIElement FrameworkElement Panel

     <DockPanel .../> 

<DockPanel .../> uses the attached Dock attribute to position content along the edges of a container. When Dock is set to Top or Bottom, it stacks the child elements above or below each other. When Dock is set to Left or Right, it stacks the child elements to the left or right of each other. You can use DockPanel to position a group of related controls, such as a set of buttons.

As with the properties of Canvas, Dock is an attached attribute and is declared by child elements. The default value of Dock is Left. The following is an example of elements declaring the DockPanel.Dock attribute:

     <DockPanel>         <Button DockPanel.Dock="Top|Right|Bottom|Left" Content="Button 1" />         <TextBox DockPanel.Dock="Top|Right|Bottom|Left" Content="This is my content" />     </DockPanel> 

Attached Attributes


DockPanel.Dock (optional)

Determines where a child element will be placed within the DockPanel


Bottom

Element is positioned at the bottom of the DockPanel in the order in which it was declared.


Left

Element is positioned at the left of the DockPanel in the order in which it was declared.


Right

Element is positioned at the right of the DockPanel in the order in which it was declared.


Top

Element is positioned at the top of the DockPanel in the order in which it was declared.




XAML in a Nutshell
XAML in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596526733
EAN: 2147483647
Year: 2007
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net