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

Sizing the Rows and Columns

The hardcoded row heights and column widths in the Start screen example work for certain resolutions, but more work would need to be done to make the UI flexible enough to handle all possible resolutions. This could be done with code-behind that checks the current window size and adjusts values accordingly, but Grid exposes sophisticated sizing options that can sometimes make such code unnecessary.

Unlike FrameworkElement’s Height and Width properties, RowDefinition’s and ColumnDefinition’s corresponding properties do not default to autosized (Double.NaN). And unlike almost all other Height and Width properties, theirs are of type GridLength rather than double. This way, Grid can uniquely support three different types ...

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