I have a user control which contains a list of items. I want to display them like the below image.
The grid has 4 columns but numbers of rows depend on the count of the items. I tried the Uniform grid and Grid but I could not find a solution.
My XAML
<ItemsControl Grid.Row="1" ItemsSource="{Binding Foods}" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Width="750" >
<local:FoodItemControl />
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
When I use the uniform grid it shows items vertically. Is there any solution to my problem?