Hierarchical templating multiple object types in silverlight
- by Dan Wray
Is it possible and if so what is the best way to implement the following hierarchical structure in a silverlight (4) TreeView control? (where Item and Group are classes which can exist in the tree).
Group
|
|-Item
|
|-Group
| |
| |-Item
| |
| |-Item
|
|-Item
The structure could of course be arbitrarily more complex than this, if needed.
HierarchicalDataTemplates appear to be the way to approach this, but I'm specifically having trouble understanding how I might apply the template to interpret the different classes correctly.
A similar question was asked for WPF, the answer for which made use of the TargetType property on the HierarchicalDataTemplate, but I am uncertain whether that property is available in the silverlight version since I don't appear to have access to it in my environment.