12
12
x : Key =" WD.DefaultTreeView"
13
13
BasedOn =" {StaticResource WD.ControlBasicStyle}"
14
14
TargetType =" {x:Type TreeView}" >
15
- <Setter Property =" ScrollViewer.HorizontalScrollBarVisibility" Value =" Auto" />
16
- <Setter Property =" ScrollViewer.VerticalScrollBarVisibility" Value =" Auto" />
17
15
<Setter Property =" BorderThickness" Value =" 1" />
18
16
<Setter Property =" Background" Value =" {DynamicResource WD.BackgroundBrush}" />
19
17
<Setter Property =" BorderBrush" Value =" {DynamicResource WD.BaseBrush}" />
20
18
<Setter Property =" Padding" Value =" {StaticResource WD.Padding}" />
19
+ <Setter Property =" ScrollViewer.HorizontalScrollBarVisibility" Value =" Auto" />
20
+ <Setter Property =" ScrollViewer.VerticalScrollBarVisibility" Value =" Auto" />
21
+ <Setter Property =" ScrollViewer.PanningMode" Value =" Both" />
22
+ <Setter Property =" Stylus.IsFlicksEnabled" Value =" False" />
23
+ <Setter Property =" VerticalContentAlignment" Value =" Center" />
21
24
<Setter Property =" Template" >
22
25
<Setter .Value>
23
- <ControlTemplate TargetType =" TreeView" >
26
+ <ControlTemplate TargetType =" {x:Type TreeView} " >
24
27
<controls : WDBorder
25
28
Padding =" {TemplateBinding Padding}"
26
29
Background =" {TemplateBinding Background}"
29
32
CornerRadius =" {Binding Path=(helpers:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
30
33
SnapsToDevicePixels =" True" >
31
34
<ScrollViewer
35
+ x : Name =" PART_ScrollViewer"
36
+ Padding =" {TemplateBinding Padding}"
37
+ Background =" {TemplateBinding Background}"
32
38
CanContentScroll =" False"
33
39
Clip =" {Binding RelativeSource={RelativeSource AncestorType=controls:WDBorder}, Path=ContentClip}"
34
- Focusable =" False" >
40
+ Focusable =" false"
41
+ HorizontalScrollBarVisibility =" {TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
42
+ SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}"
43
+ VerticalScrollBarVisibility =" {TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" >
35
44
<ItemsPresenter />
36
45
</ScrollViewer >
37
46
</controls : WDBorder >
125
134
BasedOn =" {StaticResource WD.ControlBasicStyle}"
126
135
TargetType =" {x:Type TreeViewItem}" >
127
136
<Setter Property =" Background" Value =" Transparent" />
128
- <Setter Property =" HorizontalContentAlignment" Value =" {Binding Path= HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
129
- <Setter Property =" VerticalContentAlignment" Value =" {Binding Path= VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
137
+ <Setter Property =" HorizontalContentAlignment" Value =" {Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
138
+ <Setter Property =" VerticalContentAlignment" Value =" {Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
130
139
<Setter Property =" Padding" Value =" {Binding Padding, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ItemsControl}}}" />
131
- <Setter Property =" FocusVisualStyle" Value =" {StaticResource WD.TreeViewItemFocusVisual}" />
132
- <Setter Property =" FontSize" Value =" {Binding RelativeSource={RelativeSource AncestorType=TreeView}, Path=FontSize}" />
133
- <Setter Property =" FontWeight" Value =" {Binding RelativeSource={RelativeSource AncestorType=TreeView}, Path=FontWeight}" />
134
- <Setter Property =" FontFamily" Value =" {Binding RelativeSource={RelativeSource AncestorType=TreeView}, Path=FontFamily}" />
140
+ <Setter Property =" Foreground" Value =" {DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
141
+ <Setter Property =" FocusVisualStyle" Value =" {StaticResource TreeViewItemFocusVisual}" />
135
142
<Setter Property =" Template" >
136
143
<Setter .Value>
137
144
<ControlTemplate TargetType =" {x:Type TreeViewItem}" >
143
150
</Grid .ColumnDefinitions>
144
151
<Grid .RowDefinitions>
145
152
<RowDefinition Height =" Auto" />
146
- <RowDefinition Height = " Auto " />
153
+ <RowDefinition />
147
154
</Grid .RowDefinitions>
148
155
<ToggleButton
149
156
x : Name =" Expander"
150
157
ClickMode =" Press"
151
- IsChecked =" {Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
158
+ IsChecked =" {Binding IsExpanded, RelativeSource={RelativeSource Mode= TemplatedParent}}"
152
159
Style =" {StaticResource WD.ExpandCollapseToggleStyle}" />
153
160
<Border
154
161
x : Name =" PART_Border"
162
169
<ContentPresenter
163
170
x : Name =" PART_Header"
164
171
HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}"
165
- ContentSource =" Header" />
172
+ ContentSource =" Header"
173
+ SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}" />
166
174
</Border >
167
175
<Border
168
176
x : Name =" PART_ItemsHost"
206
214
<MultiTrigger >
207
215
<MultiTrigger .Conditions>
208
216
<Condition Property =" IsSelected" Value =" True" />
209
- <Condition Property =" IsSelectionActive " Value =" False " />
217
+ <Condition SourceName = " PART_Border " Property =" IsMouseOver " Value =" True " />
210
218
</MultiTrigger .Conditions>
211
- <Setter TargetName =" PART_Border" Property =" Background" Value =" {DynamicResource WD.BackgroundBrush }" />
219
+ <Setter TargetName =" PART_Border" Property =" Background" Value =" {DynamicResource WD.BaseMoveBrush }" />
212
220
</MultiTrigger >
213
221
</ControlTemplate .Triggers>
214
222
</ControlTemplate >
215
223
</Setter .Value>
216
224
</Setter >
217
225
</Style >
226
+
218
227
<Style BasedOn =" {StaticResource WD.DefaultTreeView}" TargetType =" {x:Type TreeView}" />
219
228
<Style BasedOn =" {StaticResource WD.DefaultTreeViewItem}" TargetType =" {x:Type TreeViewItem}" />
220
229
</ResourceDictionary >
0 commit comments