I would like to make a UniformGrid take 70% of total window width and 80% of total window height. How achieve it?
<UniformGrid x:Name="Grid" Margin="20,0,0,0">
</UniformGrid>
Like the other answer suggests, you first create a Grid like so:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="8*" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<UniformGrid x:Name="yourGrid">
</UniformGrid>
</Grid>
Then you set your UniformGrid control as the child in the 0th row 0th column of the main grid. The x* notation means that you want x parts of the screen used in the row/column, so splitting rows at 8*/2* splits them at 80%/20% and splitting columns and 7*/3* splits them at 70%/30%. I hope that clears it up for you.
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