Hierarchical templating multiple object types in silverlight
Posted
by Dan Wray
on Stack Overflow
See other posts from Stack Overflow
or by Dan Wray
Published on 2010-03-22T15:37:25Z
Indexed on
2010/03/22
15:41 UTC
Read the original article
Hit count: 1041
Silverlight
|silverlight-4.0
|treeview
|silverlight-toolkit
|hierarchicaldatatemplate
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.
© Stack Overflow or respective owner