I would like to bind any XML document to WPF TreeView using TypeConverter.
My original solution was to use recursion, but when document is large UI is heavily tied u
It works for other node types with a few simple modifications. First, HierarchicalDataTemplate.ItemsSource Binding XPath must be changed to "child::node()|attribute::*" to allow any child node and any attribute. Then, add DataTriggers for other NodeTypes. The example below worked for me. NOTE that i added icons for various NodeTypes, you might want to remove them: