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}"
27
30
BorderBrush =" {TemplateBinding BorderBrush}"
28
31
BorderThickness =" {TemplateBinding BorderThickness}"
29
32
CornerRadius =" {Binding Path=(helpers:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
30
33
SnapsToDevicePixels =" True" >
31
- <ScrollViewer
32
- CanContentScroll =" False"
34
+ <controls : WDScrollViewer
35
+ x : Name =" PART_ScrollViewer"
36
+ Padding =" {TemplateBinding Padding}"
37
+ Background =" {TemplateBinding Background}"
33
38
Clip =" {Binding RelativeSource={RelativeSource AncestorType=controls:WDBorder}, Path=ContentClip}"
34
- Focusable =" False" >
39
+ Focusable =" False"
40
+ HorizontalScrollBarVisibility =" {TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
41
+ IsScrollAnimation =" {Binding Path=(helpers:TreeViewHelper.IsScrollAnimation), RelativeSource={RelativeSource TemplatedParent}}"
42
+ SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}"
43
+ VerticalScrollBarVisibility =" {TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" >
35
44
<ItemsPresenter />
36
- </ScrollViewer >
45
+ </controls : WDScrollViewer >
37
46
</controls : WDBorder >
38
47
</ControlTemplate >
39
48
</Setter .Value>
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
140
<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}" />
135
141
<Setter Property =" Template" >
136
142
<Setter .Value>
137
143
<ControlTemplate TargetType =" {x:Type TreeViewItem}" >
143
149
</Grid .ColumnDefinitions>
144
150
<Grid .RowDefinitions>
145
151
<RowDefinition Height =" Auto" />
146
- <RowDefinition Height = " Auto " />
152
+ <RowDefinition />
147
153
</Grid .RowDefinitions>
148
154
<ToggleButton
149
155
x : Name =" Expander"
150
156
ClickMode =" Press"
151
- IsChecked =" {Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
157
+ IsChecked =" {Binding IsExpanded, RelativeSource={RelativeSource Mode= TemplatedParent}}"
152
158
Style =" {StaticResource WD.ExpandCollapseToggleStyle}" />
153
159
<Border
154
160
x : Name =" PART_Border"
162
168
<ContentPresenter
163
169
x : Name =" PART_Header"
164
170
HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}"
165
- ContentSource =" Header" />
171
+ ContentSource =" Header"
172
+ SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}" />
166
173
</Border >
167
174
<Border
168
175
x : Name =" PART_ItemsHost"
206
213
<MultiTrigger >
207
214
<MultiTrigger .Conditions>
208
215
<Condition Property =" IsSelected" Value =" True" />
209
- <Condition Property =" IsSelectionActive " Value =" False " />
216
+ <Condition SourceName = " PART_Border " Property =" IsMouseOver " Value =" True " />
210
217
</MultiTrigger .Conditions>
211
- <Setter TargetName =" PART_Border" Property =" Background" Value =" {DynamicResource WD.BackgroundBrush }" />
218
+ <Setter TargetName =" PART_Border" Property =" Background" Value =" {DynamicResource WD.BaseMoveBrush }" />
212
219
</MultiTrigger >
213
220
</ControlTemplate .Triggers>
214
221
</ControlTemplate >
215
222
</Setter .Value>
216
223
</Setter >
217
224
</Style >
225
+
218
226
<Style BasedOn =" {StaticResource WD.DefaultTreeView}" TargetType =" {x:Type TreeView}" />
219
227
<Style BasedOn =" {StaticResource WD.DefaultTreeViewItem}" TargetType =" {x:Type TreeViewItem}" />
220
228
</ResourceDictionary >
0 commit comments