I have a custom type called Group which has 2 collections Products and Services and I want both these collections to appear as siblings when the Groups collection is bound to a tree, how do I do that?
Let us say you want have a hierarchical list like this:
And the underlying Group type defined like this:
Then you will have trouble binding this to a TreeView to get the above indicated effect. To achieve the above effect, you should first implement a dummy "Children" collection that is a combination of the Products and Services collection as follows:
Then create a HierarchicalDataTemplate for the Group object as follows:
This will render both the Products and Services list as siblings at the same level.
You should also declare HierarchicalDataTemplates for the Product and Service types you might have defined.
You would of course, bind the tree to a collection of Group items.