74
74
</Setter .Value>
75
75
</Setter >
76
76
</Style >
77
+
78
+ <PathGeometry x : Key =" TreeArrow" Figures =" M0.5,0.5 L0.5,8.5 L4.5,4.5 z" />
79
+
80
+ <Style x : Key =" ExpandCollapseToggleStyle" TargetType =" {x:Type ToggleButton}" >
81
+ <Style .Resources>
82
+ <PathGeometry x : Key =" ArrowCollapsed" >
83
+ <PathGeometry .Figures>
84
+ <PathFigureCollection >
85
+ <PathFigure IsClosed =" True" IsFilled =" True" StartPoint =" 0.5 0.5" >
86
+ <PathFigure .Segments>
87
+ <PathSegmentCollection >
88
+ <LineSegment Point =" 4.5 4.5" />
89
+ <LineSegment Point =" 0.5 8.5" />
90
+ </PathSegmentCollection >
91
+ </PathFigure .Segments>
92
+ </PathFigure >
93
+ </PathFigureCollection >
94
+ </PathGeometry .Figures>
95
+ </PathGeometry >
96
+ <PathGeometry x : Key =" ArrowExpanded" >
97
+ <PathGeometry .Figures>
98
+ <PathFigureCollection >
99
+ <PathFigure IsClosed =" True" IsFilled =" True" StartPoint =" 5.5 0.5" >
100
+ <PathFigure .Segments>
101
+ <PathSegmentCollection >
102
+ <LineSegment Point =" 0.5 5.5" />
103
+ <LineSegment Point =" 5.5 5.5" />
104
+ </PathSegmentCollection >
105
+ </PathFigure .Segments>
106
+ </PathFigure >
107
+ </PathFigureCollection >
108
+ </PathGeometry .Figures>
109
+ </PathGeometry >
110
+ </Style .Resources>
111
+ <Setter Property =" Focusable" Value =" False" />
112
+ <Setter Property =" Width" Value =" 16" />
113
+ <Setter Property =" Height" Value =" 16" />
114
+ <Setter Property =" Template" >
115
+ <Setter .Value>
116
+ <ControlTemplate TargetType =" {x:Type ToggleButton}" >
117
+ <Border Width =" 16" Height =" 16" Background =" Transparent" >
118
+ <Path Name =" ExpandPath"
119
+ SnapsToDevicePixels =" True"
120
+ HorizontalAlignment =" Center"
121
+ VerticalAlignment =" Center"
122
+ Data =" {StaticResource ArrowCollapsed}"
123
+ Stroke =" {DynamicResource {x:Static vsp:TreeViewColors.GlyphBrushKey}}" />
124
+ </Border >
125
+ <ControlTemplate .Triggers>
126
+ <Trigger Property =" IsChecked" Value =" True" >
127
+ <Setter Property =" Data" TargetName =" ExpandPath" Value =" {StaticResource ArrowExpanded}" />
128
+ <Setter Property =" Fill" TargetName =" ExpandPath" Value =" {DynamicResource {x:Static vsp:TreeViewColors.GlyphBrushKey}}" />
129
+ </Trigger >
130
+ <Trigger Property =" IsMouseOver" Value =" True" >
131
+ <Setter Property =" Stroke" TargetName =" ExpandPath" Value =" {DynamicResource {x:Static vsp:TreeViewColors.GlyphMouseOverBrushKey}}" />
132
+ </Trigger >
133
+ <MultiTrigger >
134
+ <MultiTrigger .Conditions>
135
+ <Condition Property =" IsChecked" Value =" True" />
136
+ <Condition Property =" IsMouseOver" Value =" True" />
137
+ </MultiTrigger .Conditions>
138
+ <Setter Property =" Fill" TargetName =" ExpandPath" Value =" {DynamicResource {x:Static vsp:TreeViewColors.GlyphMouseOverBrushKey}}" />
139
+ <Setter Property =" Stroke" TargetName =" ExpandPath" Value =" {DynamicResource {x:Static vsp:TreeViewColors.GlyphMouseOverBrushKey}}" />
140
+ </MultiTrigger >
141
+ </ControlTemplate .Triggers>
142
+ </ControlTemplate >
143
+ </Setter .Value>
144
+ </Setter >
145
+ </Style >
146
+
147
+ <Style x : Key =" TreeViewItemFocusVisual" >
148
+ <Setter Property =" Control.Template" >
149
+ <Setter .Value>
150
+ <ControlTemplate >
151
+ <Rectangle />
152
+ </ControlTemplate >
153
+ </Setter .Value>
154
+ </Setter >
155
+ </Style >
156
+
157
+ <Style TargetType =" TreeViewItem" >
158
+ <Setter Property =" Background" Value =" {DynamicResource {x:Static vsp:TreeViewColors.BackgroundBrushKey}}" />
159
+ <Setter Property =" HorizontalContentAlignment" Value =" {Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
160
+ <Setter Property =" VerticalContentAlignment" Value =" {Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
161
+ <Setter Property =" Padding" Value =" 1,0,0,0" />
162
+ <Setter Property =" Foreground" Value =" {DynamicResource {x:Static vsp:TreeViewColors.BackgroundTextBrushKey}}" />
163
+ <Setter Property =" FocusVisualStyle" Value =" {StaticResource TreeViewItemFocusVisual}" />
164
+ <Setter Property =" Template" >
165
+ <Setter .Value>
166
+ <ControlTemplate TargetType =" {x:Type TreeViewItem}" >
167
+ <Grid >
168
+ <Grid .ColumnDefinitions>
169
+ <ColumnDefinition MinWidth =" 19" Width =" Auto" />
170
+ <ColumnDefinition Width =" Auto" />
171
+ <ColumnDefinition Width =" *" />
172
+ </Grid .ColumnDefinitions>
173
+ <Grid .RowDefinitions>
174
+ <RowDefinition Height =" Auto" />
175
+ <RowDefinition />
176
+ </Grid .RowDefinitions>
177
+ <ToggleButton x : Name =" Expander"
178
+ ClickMode =" Press"
179
+ IsChecked =" {Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
180
+ Style =" {StaticResource ExpandCollapseToggleStyle}" />
181
+ <Border x : Name =" Bd" BorderBrush =" {TemplateBinding BorderBrush}" BorderThickness =" {TemplateBinding BorderThickness}" Background =" {TemplateBinding Background}" Grid.Column=" 1" Padding =" {TemplateBinding Padding}" SnapsToDevicePixels =" true" >
182
+ <ContentPresenter x : Name =" PART_Header" ContentSource =" Header" HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}" />
183
+ </Border >
184
+ <ItemsPresenter x : Name =" ItemsHost" Grid.ColumnSpan=" 2" Grid.Column=" 1" Grid.Row=" 1" />
185
+ </Grid >
186
+ <ControlTemplate .Triggers>
187
+ <Trigger Property =" IsExpanded" Value =" false" >
188
+ <Setter Property =" Visibility" TargetName =" ItemsHost" Value =" Collapsed" />
189
+ </Trigger >
190
+ <Trigger Property =" HasItems" Value =" false" >
191
+ <Setter Property =" Visibility" TargetName =" Expander" Value =" Hidden" />
192
+ </Trigger >
193
+ <Trigger Property =" IsSelected" Value =" true" >
194
+ <Setter Property =" Background" TargetName =" Bd" Value =" {DynamicResource {x:Static vsp:TreeViewColors.SelectedItemActiveBrushKey}}" />
195
+ <Setter Property =" Foreground" Value =" {DynamicResource {x:Static vsp:TreeViewColors.SelectedItemActiveTextBrushKey}}" />
196
+ </Trigger >
197
+ <MultiTrigger >
198
+ <MultiTrigger .Conditions>
199
+ <Condition Property =" IsSelected" Value =" true" />
200
+ <Condition Property =" IsSelectionActive" Value =" false" />
201
+ </MultiTrigger .Conditions>
202
+ <Setter Property =" Background" TargetName =" Bd" Value =" {DynamicResource {x:Static vsp:TreeViewColors.SelectedItemInactiveBrushKey}}" />
203
+ <Setter Property =" Foreground" Value =" {DynamicResource {x:Static vsp:TreeViewColors.SelectedItemInactiveTextBrushKey}}" />
204
+ </MultiTrigger >
205
+ <Trigger Property =" IsEnabled" Value =" false" >
206
+ <Setter Property =" Foreground" Value =" {DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
207
+ </Trigger >
208
+ </ControlTemplate .Triggers>
209
+ </ControlTemplate >
210
+ </Setter .Value>
211
+ </Setter >
212
+ <Style .Triggers>
213
+ <Trigger Property =" VirtualizingPanel.IsVirtualizing" Value =" true" >
214
+ <Setter Property =" ItemsPanel" >
215
+ <Setter .Value>
216
+ <ItemsPanelTemplate >
217
+ <VirtualizingStackPanel />
218
+ </ItemsPanelTemplate >
219
+ </Setter .Value>
220
+ </Setter >
221
+ </Trigger >
222
+ </Style .Triggers>
223
+ </Style >
77
224
</ResourceDictionary >
0 commit comments