Monday, July 28, 2014

UniformGrid Control

This has a different behavior from the Grid control. Grid cells are always the same size. The UniformGrid control typically is not used for designing entire user interfaces, but it can be useful for quickly creating layouts that require a grid of uniform size, such as a checkerboard or the buttons on a calculator.

If you set only the number of rows, additional columns will be added to accommodate new
controls. Likewise, if you set only the number of columns, additional rows will be added.

 <Grid>
  <UniformGrid Rows="2" Name="uniformGrid1" >
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
  </UniformGrid>
 </Grid>





<Grid>
<UniformGrid Columns ="2" Name="uniformGr1" >
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
            <Button Content="my1"></Button>
</UniformGrid>
</Grid>

No comments:

Post a Comment