O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

VariableSizedWrapGrid and WrapPanel

VariableSizedWrapGrid is not as versatile as Grid, but it can do one trick that Grid cannot: wrap its elements when there’s not enough space. Although its name ends in “Grid,” VariableSizedWrapGrid is more like a StackPanel than a Grid. It stacks its children vertically (by default) or horizontally based on its Orientation property, and it doesn’t define any attached properties for placing items in specific rows or columns. The stack simply wraps into new rows/columns as needed. In fact, in WPF, this panel is called WrapPanel instead (although it has fewer features).

Figure 6.10 demonstrates how the following VariableSizedWrapGrid handles various layout conditions that can be inflicted by a user in the context ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required