Now I am trying to bind parts of each node to properties on Entry. For instance, if an Entry is Visible, I want the RadTreeViewItem to be IsEnabled = False.
I've created two styles based on the style generated in the customization walkthrough of Rad Controls Silverlight Courseware (page 622) like so;
<Style x:Key="VisibleLayer" TargetType="nav:RadTreeViewItem">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="1 0 5 0"/>
<Setter Property="IsDropAllowed" Value="False"/>
<Setter Property="ItemsOptionListType" Value="Default"/>
<Setter Property="IsEnabled" Value="True"/>
<Setter Property="MinHeight" Value="24"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<Telerik_Windows_Controls_TreeView:TreeViewPanel VerticalAlignment="Bottom"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
And I've created an ItemsContainerStyleSelector
<local:LayerStyleSelector
x:Key="LayerStyleSelector"
InvisibleStyle="{StaticResource InvisibleLayer}"
VisibleStyle="{StaticResource VisibleLayer}" />
and referenced it within the data template
<telerik:HierarchicalDataTemplate x:Key="LayerDataTemplate"
ItemContainerStyleSelector="{StaticResource LayerStyleSelector}">
but I don't see any change to my items. I've even forced my style selector to only return an odd looking style to make sure SelectStyle is firing but with no changes.
What am I missing? Is this even the best way to achieve what I want?
Thanks!