我有两个图标,分别是 a 和 b;我需要我的 radtreeviewitem 在打开时显示带有图标 a 的 Expander 按钮,并在关闭时显示图标 b。流动的是两个图标
<Style x:Key="ExpanderStyleOpen" TargetType="ToggleButton">
<Setter Property="IsEnabled" Value="True" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="ToggleButton.IsChecked" Value="True" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
...
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpanderStyleClose" TargetType="ToggleButton">
<Setter Property="IsEnabled" Value="True" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="ToggleButton.IsChecked" Value="False" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
...
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
然后我的 radtreeview...
<telerik:RadTreeView Name="radTreeView"
<!--static can't change...:(-->
ExpanderStyle="{StaticResource ExpanderStyleClose}"
FontSize="12"
IsLineEnabled="True"
IsRootLinesEnabled="False"
Visibility="{Binding IsVisible}">