Prev | Current Page 206 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"


You can dock several elements against the same side. In this case, the elements simply
stack up against the side in the order they??™re declared in your markup. And, if you don??™t like
the spacing or the stretch behavior, you can tweak the Margin, HorizontalAlignment, and
VerticalAlignment properties, just as you did with the StackPanel. Here??™s a modified version
of the previous example that demonstrates:









The docking behavior is still the same. First the top buttons are docked, then the bottom
button, and finally the remaining space is divided between the side buttons and a final button
in the middle. Figure 4-10 shows the resulting window.
CHAPTER 4 n LAYOUT 91
Figure 4-10. Docking multiple elements to the top
Nesting Layout Containers
The StackPanel, WrapPanel, and DockPanel are rarely used on their own.


Pages:
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218