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>

Grid Splitter

Grid Splitter is a control provided by WPF. The GridSplitter cannot be used in isolation. It should be placed within a cell of a Grid. It should be configured to appear as a bar between two rows or two columns.

User can drag the bar with the mouse, or adjust its position using the keyboard, resizing the two columns or rows between which the GridSplitter appears.


Using a single GridSplitter is good for separating two areas that may each hold more information that can be seen at once. Adding multiple GridSplitters to a single Grid allows for flexible, resizable layouts such as those seen in Visual Studio, Microsoft Outlook or Windows Explorer.

Very useful articles



Wednesday, July 23, 2014

Alignment, Margin and Padding

Most of the time, we are experiencing the difficulty to distinguish between Margin and Padding properties in WPF applications. Following is a good example to refer,



Refer the following link,

http://msdn.microsoft.com/en-us/library/ms751709(v=vs.110).aspx