win8出来已经有一段时间了,其中主要以metrol风格的界面样式感觉很不错,最新的office2013完全使用metrol风格,感觉简洁大方。在此用wpf做一个office2013中左侧的文件夹树的属性结构样式。效果如下:
样式文件如下:
<Style x:Key="TreeViewItemFocusVisual"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <Rectangle/> </ControlTemplate> </Setter.Value> </Setter> </Style> <PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z"/> <Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Focusable" Value="False"/> <Setter Property="Width" Value="16"/> <Setter Property="Height" Value="16"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border Background="Transparent" Height="16" Padding="5,5,5,5" Width="16"> <Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="Transparent" Stroke="#838688"> <Path.RenderTransform> <RotateTransform Angle="135" CenterY="3" CenterX="3"/> </Path.RenderTransform> </Path> </Border> <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsMouseOver" Value="True" /> <Condition Property="IsChecked" Value="False" /> </MultiTrigger.Conditions> <Setter Property="Stroke" TargetName="ExpandPath" Value="transparent"/> <Setter Property="Fill" TargetName="ExpandPath" Value="#2a8dd4"/> </MultiTrigger> <MultiTrigger>