Hi,
I'm just getting started with these controls. I'm trying to bind a treeview to a hierarchical datasource of unknown/variable depth. It's recursive. The datasource is built from CategoryItems. Each CategoryItem in the CategoryList has a Children property of type CategoryList, containing 0 or more CategoryItems.
If I have a HierarchicalDataTemplate named/keyed MyTemplate, it seems like I should set MyTemplate's ItemTemplate property to "MyTemplate" in order to make it recursive. I can't see how to do that if it is a static resource (errors - "cannot find a resource named 'MyTemplate'").
Do I have to have a different HierarchicalDataTemplate defined for every possible nesting level? Is there a way to assign the ItemTemplate programmatically? Which event would I do that in?
Thx.
I'm just getting started with these controls. I'm trying to bind a treeview to a hierarchical datasource of unknown/variable depth. It's recursive. The datasource is built from CategoryItems. Each CategoryItem in the CategoryList has a Children property of type CategoryList, containing 0 or more CategoryItems.
If I have a HierarchicalDataTemplate named/keyed MyTemplate, it seems like I should set MyTemplate's ItemTemplate property to "MyTemplate" in order to make it recursive. I can't see how to do that if it is a static resource (errors - "cannot find a resource named 'MyTemplate'").
Do I have to have a different HierarchicalDataTemplate defined for every possible nesting level? Is there a way to assign the ItemTemplate programmatically? Which event would I do that in?
Thx.