如何在Silverlight中展开整个TreeView?在Silverlight中展开整个TreeView
编辑:这里是XAML:
<controls:TreeView x:Name="tv">
<controls:TreeView.ItemTemplate>
<common:HierarchicalDataTemplate ItemsSource="{Binding Children}">
<CheckBox IsChecked="{Binding Visible, Mode=TwoWay}" Content="{Binding Name}"/>
</common:HierarchicalDataTemplate>
</controls:TreeView.ItemTemplate>
</controls:TreeView>
也许使用的ItemTemplate使得任何指数ItemContainerGenerator.ContainerFromIndex返回NULL?
从2011年的SL4角度来看,我所要做的就是创建如图所示的专业化,它已经完成了绑定,所以不需要第三个,首先只是为了解释,在隐式样式中绑定到“IsExpanded”并不适用于我,并且以一个名为''的只读属性为例。 – flq 2011-08-10 14:55:12