Prev | Current Page 221 | Next

Matthew MacDonald

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

To make it usable, you need to give it a minimum
size. In the case of a vertical splitter bar (like the one in Figure 4-13), you need to
set the VerticalAlignment to Stretch (so it fills the whole height of the available area) and
the Width to a fixed size (such as 10 device-independent units). In the case of a horizontal
splitter bar, you need to set HorizontalAlignment to Stretch, and Height to a fixed
size.
??? The GridSplitter alignment also determines whether the splitter bar is horizontal (used
to resize rows) or vertical (used to resize columns). In the case of a horizontal splitter
bar, you should set VerticalAlignment to Center (which is the default value) to indicate
that dragging the splitter resizes the rows that are above and below. In the case of a vertical
splitter bar (like the one in Figure 4-13), you should set HorizontalAlignment to
Center to resize the columns on either side.
CHAPTER 4 n LAYOUT 100
nNote You can change the resizing behavior using the ResizeDirection and ResizeBehavior properties of
the GridSplitter. However, it??™s simpler to let this behavior depend entirely on the alignment settings, which is
the default.
Dizzy yet? To reinforce these rules, it helps to take a look at the actual markup for the
example shown in Figure 4-13. In the following listing, the GridSplitter details are highlighted:



Pages:
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233