I have DataTemplate:
<DataTemplate DataType="{x:Type PointCollection}">
<Polygon Stroke="Blue" Points="{Binding}"Fill="White"/>
</DataTemplate>
and I need to put PointCollection in Points property of Polygon. What syntax for this?
I use CompositeCollection as ItemsSource, which contains objects of different types, so, I can't just bind some property of my Model.
Here is an example which uses a ListBox to hold the points collections.
Now it is simply a matter of loading up the AllPoints list
When run I get this output
Update
Here is using a composite collection
Here are all the data templates
And the result showing three different objects:
See my answer using an
ObserableCollection<T>
(where the ship and passage both had the same interface) here on SO How to format a string in XAML without changing viewmodel's property getter?.