I use Height="*" a bit to mean that the height of the last row should fill to the bottom of the grid.
But what does "10*" mean?
<Grid Name="mainGrid"> <Grid.RowDefinitions> <RowDefinition Height="100" /> <RowDefinition Height="40" /> <RowDefinition Height="10*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="200" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> </Grid>
The Grid element in XAML represents a WPF Grid control. The following code snippet creates a Grid control, sets it width and foreground color and make sure grid lines are visible. The ColumnDefinitions property is used to add columns and the RowDefinitions property is used to add rows to a Grid.
"*"
is shorthand for "1*"
. It's a ratio, so if you have two rows, one with "*"
and one with "10*"
, the former gets 1/11th of the available and the latter gets 10/11th of the space.
In your example above, "10*"
is unnecessary - "*"
would make more sense because there is only one row using ratio-based sizing, so any ratio will equate to 100% of the available space.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With