日期:2014-05-17  浏览次数:21017 次

WPF TreeView 样式
美工出了一张图。。。

没做过类似的效果啊 
给个提示 或者谁有源代码 发我一个啊

------解决方案--------------------
WPF TreeView的简单使用例子
http://www.cnblogs.com/izualx/archive/2011/02/03/1949055.html
------解决方案--------------------

 <Style x:Key="styleTreeViewExpandCollapse" TargetType="{x:Type ToggleButton}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <TextBlock x:Name="icon" VerticalAlignment="Center" TextAlignment="Right" Text="+" Cursor="Hand"/>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="true">
                                <Setter TargetName="icon" Property="Text" Value="-" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="{x:Type TreeViewItem}">
            <Setter Property="IsExpanded" Value="{Binding IsExpanded}"/>
            <Setter Property="IsSelected" Value="false" />
            <Setter Property="Template">
                <Setter.Value>
   &