开发者

Style expander buttons of TreeView

Here is my XAML:

            <Style x:Key="ExpanderStyle" TargetType="{x:Type ToggleButton}">
            <Setter Property="IsEnabled" Value="True" />
            <Setter Property="Template">
               开发者_StackOverflow社区 <Setter.Value>
                    <ControlTemplate>
                        <Image Source="/Images/SHCalendarLeftArrow.tiff" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

So what I want is so that if the item is expanded, then display a different image.


Nevermind. I used a trigger

<Trigger Property="ToggleButton.IsChecked" Value="False">
                            <Setter x:Name="Expander_Expanded"
                                    TargetName="Expander_Normal" Property="Source"
                                    Value="/Images/SHCalendarLeftArrow.tiff" />
                        </Trigger>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜