In the preceding example, we have seen that the items inside the WrapPanel have their individual size mentioned along with them. You can also set the size for all the items to a specific value by setting the ItemWidth and ItemHeight properties, as shown in the following code snippet:
<WrapPanel Orientation="Vertical" ItemWidth="100" ItemHeight="30"> <Button Content="Button 1" Margin="4" /> <Button Content="Button 2" Margin="4" /> <Button Content="Button 3" Margin="4" /> <Button Content="Button 4" Margin="4" /> <Button Content="Button 5" Margin="4" /> <Button Content="Button 6" Margin="4" /> </WrapPanel>
In this case, you won't need to specify the size individually to each child element. When you run the preceding code, you will see...