As with all WPF controls and most
visual elements, these classes are found in the System.Windows.Controls namespace.
Table 4-2. Core Layout Panels
Name Description
StackPanel Places elements in a horizontal or vertical stack. This layout container is
typically used for small sections of a larger, more complex window.
WrapPanel Places elements in a series of wrapped lines. In horizontal orientation, the
WrapPanel lays items out in a row from left to right and then onto subsequent
lines. In vertical orientation, the WrapPanel lays out items in a top-to-bottom
column and then uses additional columns to fit the remaining items.
DockPanel Aligns elements against an entire edge of the container.
Grid Arranges elements in rows and columns according to an invisible table. This is
one of the most flexible and commonly used layout containers.
UniformGrid Places elements in an invisible table but forces all cells to have the same size.
This layout container is used infrequently.
Canvas Allows elements to be positioned absolutely using fixed coordinates. This layout
container is the most similar to traditional Windows Forms, but it doesn??™t provide
anchoring or docking features. As a result, it??™s an unsuitable choice for a
resizable window unless you??™re willing to do a fair bit of work.
CHAPTER 4 n LAYOUT 80
Along with these core containers, there are several more specialized panels that you??™ll
encounter in various controls.
Pages:
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202