Prev | Current Page 242 | Next

Matthew MacDonald

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

Row="1" Grid.Column="0" Name="cmdClose"
Margin="10,3,10,10">Close

The event handlers for the CheckBox aren??™t shown here. They simply change the text in
the two buttons.
A Modular User Interface
Many of the layout containers gracefully ???flow??? content into the available space, like the Stack-
Panel, DockPanel, and WrapPanel. One advantage of this approach is that it allows you to
create truly modular interfaces. In other words, you can plug in different panels with the
appropriate user interface sections you want to show and leave out those that don??™t apply. The
entire application can shape itself accordingly, somewhat like a portal site on the Web.
Figure 4-22 demonstrates. It places several separate panels into a WrapPanel. The user
can choose which of these panels are visible using the check boxes at the top of the window.
Figure 4-22. A series of panels in a WrapPanel
nNote Although you can set the background of a layout panel, you can??™t set a border around it. This
example overcomes that limitation by wrapping each panel in a Border element that outlines the exact
dimensions. You??™ll learn how to use the Border and other similarly specialized containers in the next chapter.
CHAPTER 4 n LAYOUT 115
As different panels are hidden, the remaining panels reflow themselves to fit the available
space (and the order in which they??™re declared).


Pages:
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254