How can you enable auto-DataTemplate selection based on data type like you can with an items control?
DataType
, for whatever crazy reason, is of type Object
, the DataTemplates
hence have a string
set in that property unless you use x:Type
.
Edit: There is a very good reason for the property being an object, as always those who can (and do) read are clearly at an advantage:
If the template is intended for object data, this property contains the type name of the data object (as a string). To refer to the type name of the class, use the x:Type Markup Extension. If the template is intended for XML data, this property contains the XML element name. See the documentation remarks for details about specifying a non-default namespace for the XML element.