Prev | Current Page 225 | Next

Matthew MacDonald

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

. -->
Height="3" VerticalAlignment="Center" HorizontalAlignment="Stretch"
ShowsPreview="False">



nTip Remember, if a Grid has just a single row or column, you can leave out the RowDefinitions section.
Also, elements that don??™t have their row position explicitly set are assumed to have a Grid.Row value of 0
and are placed in the first row. The same holds true for elements that don??™t supply a Grid.Column value.
Shared Size Groups
As you??™ve seen, a Grid contains a collection of rows and columns, which are sized explicitly,
proportionately, or based on the size of their children. There??™s one other way to size a row or
a column??”to match the size of another row or column. This works through a feature called
shared size groups.
The goal of shared size groups is to keep separate portions of your user interface consistent.
For example, you might want to size one column to fit its content and size another
column to match that size exactly. However, the real benefit of shared size groups is to give the
same proportions to separate Grid controls.
CHAPTER 4 n LAYOUT 103
To understand how this works, consider the example shown in Figure 4-15. This window
features two Grid objects??”one at the top of the window (with three columns) and one at the
bottom (with two columns).


Pages:
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237