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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access