-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScrollBarStyle.xaml
174 lines (159 loc) · 9.13 KB
/
ScrollBarStyle.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="ScrollBarRepeatButtonStyle" TargetType="RepeatButton">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Interval" Value="50"/>
</Style>
<Style x:Key="ScrollBarTrackerRepeatButtonStyle" TargetType="RepeatButton" BasedOn="{StaticResource ScrollBarRepeatButtonStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Background="Transparent"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarRepeatButtonHorizontalStyle" TargetType="RepeatButton" BasedOn="{StaticResource ScrollBarRepeatButtonStyle}">
<Setter Property="Width" Value="16"/>
<Setter Property="Margin" Value="1"/>
</Style>
<Style x:Key="ScrollBarScrollLeftButtonStyle" TargetType="RepeatButton" BasedOn="{StaticResource ScrollBarRepeatButtonHorizontalStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Background="Transparent">
<Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z" Stretch="Uniform" Fill="{TemplateBinding Foreground}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarScrollRightButtonStyle" TargetType="RepeatButton" BasedOn="{StaticResource ScrollBarRepeatButtonHorizontalStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Background="Transparent">
<Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z" Stretch="Uniform" Fill="{TemplateBinding Foreground}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarRepeatButtonVerticalStyle" TargetType="RepeatButton" BasedOn="{StaticResource ScrollBarRepeatButtonStyle}">
<Setter Property="Height" Value="16"/>
<Setter Property="Margin" Value="1"/>
</Style>
<Style x:Key="ScrollBarScrollUpButtonStyle" TargetType="RepeatButton" BasedOn="{StaticResource ScrollBarRepeatButtonVerticalStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Background="Transparent">
<Path Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z" Stretch="Uniform" Fill="{TemplateBinding Foreground}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarScrollDownButtonStyle" TargetType="RepeatButton" BasedOn="{StaticResource ScrollBarRepeatButtonVerticalStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border Background="Transparent">
<Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z" Stretch="Uniform" Fill="{TemplateBinding Foreground}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarThumbHorizontalStyle" TargetType="Thumb">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Grid Margin="0,1,0,1">
<Rectangle x:Name="Background" StrokeThickness="1" Fill="{TemplateBinding Foreground}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarThumbVerticalStyle" TargetType="Thumb">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Grid Margin="1,0,1,0">
<Rectangle x:Name="Background" StrokeThickness="1" Fill="{TemplateBinding Foreground}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="ScrollBarHorizontalTemplate" TargetType="ScrollBar">
<Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Margin="{TemplateBinding Margin}">
<Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<RepeatButton Command="ScrollBar.LineLeftCommand" Grid.Column="0" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarScrollLeftButtonStyle}" />
<Track x:Name="PART_Track" IsDirectionReversed="False" Grid.Column="1">
<Track.DecreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageLeftCommand" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarTrackerRepeatButtonStyle}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarThumbHorizontalStyle}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageRightCommand" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarTrackerRepeatButtonStyle}" />
</Track.IncreaseRepeatButton>
</Track>
<RepeatButton Command="ScrollBar.LineRightCommand" Grid.Column="2" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarScrollRightButtonStyle}" />
</Grid>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="ScrollBarVerticalTemplate" TargetType="ScrollBar">
<Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Margin="{TemplateBinding Margin}">
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<RepeatButton Command="ScrollBar.LineUpCommand" Grid.Row="0" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarScrollUpButtonStyle}" />
<Track x:Name="PART_Track" IsDirectionReversed="True" Grid.Row="1">
<Track.DecreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageUpCommand" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarTrackerRepeatButtonStyle}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarThumbVerticalStyle}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageDownCommand" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarTrackerRepeatButtonStyle}" />
</Track.IncreaseRepeatButton>
</Track>
<RepeatButton Command="ScrollBar.LineDownCommand" Grid.Row="2" Foreground="{TemplateBinding Foreground}" Style="{StaticResource ScrollBarScrollDownButtonStyle}" />
</Grid>
</Border>
</ControlTemplate>
<Style x:Key="ScrollBarStyle" TargetType="{x:Type ScrollBar}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Foreground" Value="#2F000046"/>
<Setter Property="Background" Value="Transparent"/>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Width" Value="Auto" />
<Setter Property="Template" Value="{StaticResource ScrollBarHorizontalTemplate}" />
</Trigger>
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="Height" Value="Auto" />
<Setter Property="Template" Value="{StaticResource ScrollBarVerticalTemplate}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="#8F000046"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="ScrollBar" BasedOn="{StaticResource ScrollBarStyle}"/>
</ResourceDictionary>