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

Comparing Grid to Other Panels

Grid is the best choice for most complex layout scenarios because it can do everything done by the previous panels and more. Grid can also accomplish layout that would otherwise require multiple panels. To demonstrate that Grid is usually the best choice, it’s interesting to see how to mimic the behavior of other panels with Grid, knowing that you can take advantage of Grid’s extra features at any time.

Mimicking Canvas with Grid

If you leave Grid with a single row and column and set the HorizontalAlignment and VerticalAlignment of all children to values other than Stretch, the children get added to the single cell just as they do in a Canvas. Setting HorizontalAlignment to Left and VerticalAlignment to Top is ...

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