Thursday, December 28, 2017

Difference between * and Auto

"*" means stretch to fill the available space, and is a fraction, so if one row is * and the other row is 2* then the second row will be twice the size of the first row.
Auto means it takes whatever/or only space it needs.
   <RowDefinition Height="*"/>
   <RowDefinition Height="Auto"/>

  <Button Content="Test" Grid.Row="1" />

So for example, you may have two rows, bottom row has a button and is Auto (only as high as the button) and the top row is "*" - stretches to the remaining space available.

No comments: