I defined in XAML DataTemplate for my own type.
<DataTemplate DataType="{x:Type MyType}">
...
</DataTemplate>
Now I want to add one more template for the same type in the same scope. How would I choose then which of templates to use in concrete ItemsControl?
Background:
I have ItemsControl that displays objects of different types (derived from one base class of course) in different way depending on the item’s type. So I’ve specified unnamed data templates for each type. Now I need to show the same data but with new templates (old templates supported editing, new ones – not).
you would need to use DataTemplateSelector (msdn link)