Prev | Current Page 228 | Next

Matthew MacDonald

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

You might assume
that shared size groups are limited to the current window, but WPF is even more stringent
than that. To share a group, you need to explicitly set the attached Grid.IsSharedSizeScope
CHAPTER 4 n LAYOUT 105
property to True on a container somewhere upstream that holds the Grid objects with the
shared column. In the current example, the top and bottom Grid are wrapped in another Grid
that accomplishes this purpose, although you could just as easily use a different container
such as a DockPanel or StackPanel.
Here??™s the markup for the top-level Grid:







...



...


nTip You could use a shared size group to synchronize a separate Grid with column headers. The width of
each column can then be determined by the content in the column, which the header will share. You could
even place a GridSplitter in the header, which the user could drag to resize the header and the entire column
underneath.


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