UniformGrid does not have any restriction on setting the number of rows and columns. You can set the numbers by assigning the Rows and Columns properties. For example, the following XAML will render the elements in a single row only, as we assigned Rows="1":
<UniformGrid Rows="1"> <Label Content="Cell 1" Background="Yellow" /> <Label Content="Cell 2" Background="YellowGreen" /> <Label Content="Cell 3" Background="Orange" /> <Label Content="Cell 4" Background="OrangeRed" /> <Label Content="Cell 5" Background="Violet" /> <Label Content="Cell 6" Background="DeepSkyBlue" /> <Label Content="Cell 7" Background="SkyBlue" /> </UniformGrid>
The preceding example will have the following output:
If you set Columns=...