Hello!
Here are the DataTemplates:
<DataTemplate DataType="{x:Type data:Item}" x:Key="ItemTemplate">
<Border/>
</DataTemplate>
<DataTemplate DataType="{x:Type data:StyleItem}" x:Key="StyleItemTemplate">
<Border>
<ContentControl Content="{Binding Item}"
ContentTemplate="{StaticResource ItemTemplate}"/>
</Border>
</DataTemplate>
I am trying to bind a List<StyleItem>
to an ItemsControl,
setting ItemTemplate="{StaticResource StyleItemTemplate}"
, but then I get a System.Reflection.AmbiguousMatchException
.
I read this post, and althoug the StyleItem and Item classes are not generic classes, anyhow; I don't know how to use the parenthsis solution in my situation.
The Item
and StyleItem
classes are generated EF entities that inherit from System.Data.Objects.DataClasses.EntityObject
, and implement System.ComponentModel.IDataErrorInfo
.