How to specify unique container styles for heterogenous hierarchies using SL3 and TreeView control

Posted by rcecil on Stack Overflow See other posts from Stack Overflow or by rcecil
Published on 2010-05-17T20:05:07Z Indexed on 2010/05/17 20:11 UTC
Read the original article Hit count: 243

Hello,

Just look for strategies that have been successful in rendering hierarchies that represent inheritance structures using SL3/4 TreeViews. I need to render certain nodes differently than others, depending upon what kind of container they are (a choice between things, or simply a list of related things, etc.)

So far, I've been very successful with the DataTemplate route: I've been able to use a technique described in Ted Glaza's post "Easy DataTemplateSelectors in Silverlight" (you may have retrieve a Google cache of this page). SO what I'm trying to discover is something on the order of a StyleSelector, not a DataTemplateSelector. I'm considering leveraging my current implementations of Glaza's pattern of selector objects to somehow detect the node type and set the ItemContainerStyle there, but it doesn't seem clear right now.

Thanks for your thoughts.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about treeview