Prev | Current Page 209 | Next

Matthew MacDonald

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


nTip If you have a densely nested tree of elements, it??™s easy to lose sight of the overall structure. Visual
Studio provides a handy feature that shows you a tree representation of your elements and allows you to
click your way down to the element you want to look at (or modify). This feature is the Document Outline
window, and you can show it by choosing View ??° Other Windows ??° Document Outline from the menu.
CHAPTER 4 n LAYOUT 93
The Grid
The Grid is the most powerful layout container in WPF. Much of what you can accomplish with
the other layout controls is also possible with the Grid. The Grid is also an ideal tool for carving
your window into smaller regions that you can manage with other panels. In fact, the Grid
is so useful that when you add a new XAML document for a window in Visual Studio, it automatically
adds the Grid tags as the first-level container, nested inside the root Window
element.
The Grid separates elements into an invisible grid of rows and columns. Although more
than one element can be placed in a single cell (in which case they overlap), it generally makes
sense to place just a single element per cell. Of course, that element may itself be another layout
container that organizes its own group of contained controls.
nTip Although the Grid is designed to be invisible, you can set the Grid.


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