I need something like this:
<WrapPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Person.Name}" Style="style1"/>
<TextBlock Text="{Binding Path=Project.Name}" Style="style2" />
foreach item in {Binding Path=Tags}
{
<TextBlock Text={Binding item.Name} Style="style3" />
}
</WrapPanel>
I have done it through code, but I would prefer to have it in XAML, as this is somewhat common and basic functionality + I want to see it in designer with my sample data to style it well.
I tried to use ItemsControl to populate the collection, but it always creates it’s own panel, which obviously breaks wrapping.
I think one could also request to throw another collection there.
How to do it without writing code?
Why not use an items control with the
WrapPanelas theItemsControl.ItemsPanel? For multiple sources you can use theCompositeCollectionto group them to display in your itemscontrol.