Using HierarchicalDataTemplate's DataType to handle Generic XML Data (via XmlDataProvider)



Goal: create UI to display generic XML in a treeView using HierarchicalDataTemplate's dataType parameter keying off different type of XmlNodes (such as XmlElement and XmlAttribute)


sample:





<HierarchicalDataTemplate DataType="{x:Type system_xml:XmlElement}">
...
</HierarchicalDataTemplate>

<HierarchicalDataTemplate DataType="{x:Type system_xml:XmlAttribute}">
...
</HierarchicalDataTemplate>



This does not seem to work. I'm aware you can set DataType to name of specific XML tags, but I'd like to handle any XML.


Thanks


No comments:

Post a Comment