11<ResourceDictionary xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22 xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml" >
33
4+ <Style x : Key =" ExpandCollapseToggleStyle" TargetType =" ToggleButton" >
5+ <Setter Property =" Focusable" Value =" False" />
6+ <Setter Property =" Template" >
7+ <Setter .Value>
8+ <ControlTemplate TargetType =" ToggleButton" >
9+ <Grid Width =" 15" Height =" 13" Background =" Transparent" >
10+ <Path x : Name =" ExpandPath" HorizontalAlignment =" Left" VerticalAlignment =" Center" Margin =" 1,1,1,1" Fill =" {StaticResource GlyphBrush}" Data =" M 4 0 L 8 4 L 4 8 Z" />
11+ </Grid >
12+ <ControlTemplate .Triggers>
13+ <Trigger Property =" IsChecked" Value =" True" >
14+ <Setter Property =" Data" TargetName =" ExpandPath" Value =" M 0 4 L 8 4 L 4 8 Z" />
15+ </Trigger >
16+ </ControlTemplate .Triggers>
17+ </ControlTemplate >
18+ </Setter .Value>
19+ </Setter >
20+ </Style >
21+ <Style x : Key =" TreeViewItemFocusVisual" >
22+ <Setter Property =" Control.Template" >
23+ <Setter .Value>
24+ <ControlTemplate >
25+ <Border >
26+ <Rectangle Margin =" 0,0,0,0" StrokeThickness =" 5" Stroke =" Black" StrokeDashArray =" 1 2" Opacity =" 0" />
27+ </Border >
28+ </ControlTemplate >
29+ </Setter .Value>
30+ </Setter >
31+ </Style >
32+ 433 <Style TargetType =" {x:Type TreeViewItem}" >
534 <Setter Property =" BorderThickness" Value =" 1" />
635 <Setter Property =" Padding" Value =" 4,1,0,1" />
7- <Style .Triggers>
8- <Trigger Property =" IsSelected" Value =" True" >
9- <Setter Property =" Foreground" Value =" White" />
10- <Setter Property =" BorderBrush" Value =" #7ea3be" />
11- </Trigger >
12- <MultiDataTrigger >
13- <MultiDataTrigger .Conditions>
14- <Condition Binding =" {Binding IsSelected, RelativeSource={RelativeSource Self}}" Value =" True" />
15- <Condition Binding =" {Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=DataGrid}}" Value =" False" />
16- </MultiDataTrigger .Conditions>
17- <Setter Property =" BorderBrush" Value =" LightGray" />
18- <Setter Property =" Foreground" Value =" Gray" />
19- </MultiDataTrigger >
20- 21- <MultiDataTrigger >
22- <MultiDataTrigger .Conditions>
23- <Condition Binding =" {Binding IsSelected, RelativeSource={RelativeSource Self}}" Value =" True" />
24- <Condition Binding =" {Binding ContextMenu.IsOpen, RelativeSource={RelativeSource AncestorType=DataGrid}}" Value =" True" />
25- </MultiDataTrigger .Conditions>
26- <Setter Property =" Foreground" Value =" White" />
27- <Setter Property =" BorderBrush" Value =" #7ea3be" />
28- </MultiDataTrigger >
29- </Style .Triggers>
36+ <Setter Property =" Template" >
37+ <Setter .Value>
38+ <ControlTemplate TargetType =" {x:Type TreeViewItem}" >
39+ <Grid >
40+ <Grid .ColumnDefinitions>
41+ <ColumnDefinition MinWidth =" 19" Width =" Auto" />
42+ <ColumnDefinition Width =" Auto" />
43+ <ColumnDefinition Width =" *" />
44+ </Grid .ColumnDefinitions>
45+ <Grid .RowDefinitions>
46+ <RowDefinition Height =" Auto" />
47+ <RowDefinition />
48+ </Grid .RowDefinitions>
49+ <ToggleButton x : Name =" Expander" Style =" {StaticResource ExpandCollapseToggleStyle}" IsChecked =" {Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" ClickMode =" Press" />
50+ <Border Name =" Bd" Grid.Column=" 1" Background =" {TemplateBinding Background}" BorderBrush =" {TemplateBinding BorderBrush}" BorderThickness =" {TemplateBinding BorderThickness}" Padding =" {TemplateBinding Padding}" >
51+ <ContentPresenter x : Name =" PART_Header" ContentSource =" Header" HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}" />
52+ </Border >
53+ <ItemsPresenter x : Name =" ItemsHost" Grid.Row=" 1" Grid.Column=" 1" Grid.ColumnSpan=" 2" />
54+ </Grid >
55+ <ControlTemplate .Triggers>
56+ <Trigger Property =" IsExpanded" Value =" false" >
57+ <Setter TargetName =" ItemsHost" Property =" Visibility" Value =" Collapsed" />
58+ </Trigger >
59+ <Trigger Property =" HasItems" Value =" false" >
60+ <Setter TargetName =" Expander" Property =" Visibility" Value =" Hidden" />
61+ </Trigger >
62+ <MultiTrigger >
63+ <MultiTrigger .Conditions>
64+ <Condition Property =" HasHeader" Value =" false" />
65+ <Condition Property =" Width" Value =" Auto" />
66+ </MultiTrigger .Conditions>
67+ <Setter TargetName =" PART_Header" Property =" MinWidth" Value =" 75" />
68+ </MultiTrigger >
69+ <MultiTrigger >
70+ <MultiTrigger .Conditions>
71+ <Condition Property =" HasHeader" Value =" false" />
72+ <Condition Property =" Height" Value =" Auto" />
73+ </MultiTrigger .Conditions>
74+ <Setter TargetName =" PART_Header" Property =" MinHeight" Value =" 19" />
75+ </MultiTrigger >
76+ <Trigger Property =" IsSelected" Value =" true" >
77+ <Setter TargetName =" Bd" Property =" Background" Value =" {StaticResource DataGridHighlightBrush}" />
78+ <Setter Property =" Foreground" Value =" #fff" />
79+ <Setter TargetName =" Bd" Property =" BorderBrush" Value =" #7ea3be" />
80+ </Trigger >
81+ <MultiTrigger >
82+ <MultiTrigger .Conditions>
83+ <Condition Property =" IsSelected" Value =" true" />
84+ <Condition Property =" IsSelectionActive" Value =" false" />
85+ </MultiTrigger .Conditions>
86+ <Setter TargetName =" Bd" Property =" Background" Value =" {StaticResource DataGridHighlightBlurBrush}" />
87+ <Setter TargetName =" Bd" Property =" BorderBrush" Value =" #bebebe" />
88+ <Setter Property =" Foreground" Value =" #000" />
89+ </MultiTrigger >
90+ <MultiDataTrigger >
91+ <MultiDataTrigger .Conditions>
92+ <Condition Binding =" {Binding IsSelected, RelativeSource={RelativeSource Self}}" Value =" True" />
93+ <Condition Binding =" {Binding ContextMenu.IsOpen, RelativeSource={RelativeSource AncestorType=TreeViewItem}}" Value =" True" />
94+ </MultiDataTrigger .Conditions>
95+ 96+ <Setter TargetName =" Bd" Property =" Background" Value =" {StaticResource DataGridHighlightBrush}" />
97+ <Setter Property =" Foreground" Value =" #fff" />
98+ <Setter TargetName =" Bd" Property =" BorderBrush" Value =" #7ea3be" />
99+ </MultiDataTrigger >
100+ <Trigger Property =" IsEnabled" Value =" false" >
101+ <Setter Property =" Foreground" Value =" {DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
102+ </Trigger >
103+ </ControlTemplate .Triggers>
104+ </ControlTemplate >
105+ </Setter .Value>
106+ </Setter >
30107 <Style .Resources>
31108 <Style TargetType =" Border" >
32109 <Setter Property =" CornerRadius" Value =" 2" />
33110 </Style >
34111 </Style .Resources>
35112 </Style >
36- 37- <LinearGradientBrush x : Key =" {x:Static SystemColors.HighlightBrushKey}" EndPoint =" 0,1" StartPoint =" 0,0" >
38- <GradientStop Color =" #b3e5fc" Offset =" 0" />
39- <GradientStop Color =" #8cc8e3" Offset =" 0.1" />
40- <GradientStop Color =" #83bad2" Offset =" 0.45" />
41- <GradientStop Color =" #609fbb" Offset =" 0.9" />
42- <GradientStop Color =" #9fd3eb" Offset =" 1" />
43- </LinearGradientBrush >
44- 45- <LinearGradientBrush x : Key =" {x:Static SystemColors.ControlBrushKey}" EndPoint =" 0,1" StartPoint =" 0,0" >
46- <GradientStop Color =" #fcfcfc" Offset =" 0" />
47- <GradientStop Color =" #e3e3e3" Offset =" 0.1" />
48- <GradientStop Color =" #d2d2d2" Offset =" 0.45" />
49- <GradientStop Color =" #c8c8c8" Offset =" 0.9" />
50- <GradientStop Color =" #ebebeb" Offset =" 1" />
51- </LinearGradientBrush >
52- 53- <SolidColorBrush x : Key =" {x:Static SystemColors.HighlightTextBrushKey}" Color =" #eee" />
54- <SolidColorBrush x : Key =" {x:Static SystemColors.ControlTextBrushKey}" Color =" #666" />
55113</ResourceDictionary >
0 commit comments