1
+ <ResourceDictionary xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
3
+ xmlns : local =" clr-namespace:MaterialDesignThemes.MahApps.Themes"
4
+ xmlns : controls =" http://metro.mahapps.com/winfx/xaml/controls" >
5
+
6
+ <ResourceDictionary .MergedDictionaries>
7
+ <ResourceDictionary Source =" pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Slider.xaml" />
8
+ </ResourceDictionary .MergedDictionaries>
9
+
10
+ <ControlTemplate x : Key =" MaterialDesignMahAppsRangeSliderHorizontal"
11
+ TargetType =" controls:RangeSlider" >
12
+ <StackPanel Name =" PART_Container"
13
+ Orientation =" Vertical"
14
+ HorizontalAlignment =" Stretch"
15
+ VerticalAlignment =" Center" >
16
+ <TickBar Name =" PART_TopTick"
17
+ Placement =" Top"
18
+ Fill =" {TemplateBinding Foreground}"
19
+ TickFrequency =" {TemplateBinding TickFrequency}"
20
+ Minimum =" {TemplateBinding Minimum}"
21
+ Maximum =" {TemplateBinding Maximum}"
22
+ Height =" 4"
23
+ Margin =" 5,0,5,2"
24
+ Visibility =" Collapsed" />
25
+ <StackPanel Name =" PART_RangeSliderContainer"
26
+ Background =" Transparent"
27
+ Orientation =" Horizontal"
28
+ HorizontalAlignment =" Stretch"
29
+ VerticalAlignment =" Center"
30
+ Panel.ZIndex=" 1" >
31
+ <RepeatButton Name =" PART_LeftEdge"
32
+ Background =" {DynamicResource MaterialDesignCheckBoxOff}"
33
+ Height =" 2"
34
+ Style =" {DynamicResource HorizontalTrackLargeDecrease}" />
35
+ <Thumb Name =" PART_LeftThumb"
36
+ Cursor =" Arrow"
37
+ Foreground =" {DynamicResource PrimaryHueMidBrush}"
38
+ Template =" {StaticResource MaterialDesignSliderThumb}"
39
+ Panel.ZIndex=" 1" />
40
+ <Thumb Name =" PART_MiddleThumb"
41
+ Cursor =" Hand"
42
+ MinWidth =" {TemplateBinding MinRangeWidth}" >
43
+ <Thumb .Style>
44
+ <Style TargetType =" Thumb" >
45
+ <Setter Property =" Template" >
46
+ <Setter .Value>
47
+ <ControlTemplate >
48
+ <Rectangle Height =" 2"
49
+ Margin =" 0,0,0,0"
50
+ Fill =" {DynamicResource PrimaryHueMidBrush}" />
51
+ </ControlTemplate >
52
+ </Setter .Value>
53
+ </Setter >
54
+ </Style >
55
+ </Thumb .Style>
56
+ </Thumb >
57
+ <Thumb Name =" PART_RightThumb"
58
+ Cursor =" Arrow"
59
+ Foreground =" {DynamicResource PrimaryHueMidBrush}"
60
+ Template =" {StaticResource MaterialDesignSliderThumb}"
61
+ Panel.ZIndex=" 1" />
62
+ <RepeatButton Name =" PART_RightEdge"
63
+ Height =" 2"
64
+ Background =" {DynamicResource MaterialDesignCheckBoxOff}"
65
+ Style =" {DynamicResource HorizontalTrackLargeDecrease}" />
66
+ </StackPanel >
67
+ <TickBar Name =" PART_BottomTick"
68
+ Fill =" {TemplateBinding Foreground}"
69
+ Placement =" Top"
70
+ TickFrequency =" {TemplateBinding TickFrequency}"
71
+ Minimum =" {TemplateBinding Minimum}"
72
+ Maximum =" {TemplateBinding Maximum}"
73
+ Height =" 4"
74
+ Margin =" 5,2,5,0"
75
+ Visibility =" Collapsed" />
76
+ </StackPanel >
77
+ <ControlTemplate .Triggers>
78
+ <Trigger Property =" TickPlacement" Value =" TopLeft" >
79
+ <Setter Property =" Visibility" TargetName =" PART_TopTick" Value =" Visible" />
80
+ </Trigger >
81
+ <Trigger Property =" TickPlacement" Value =" BottomRight" >
82
+ <Setter Property =" Visibility" TargetName =" PART_BottomTick" Value =" Visible" />
83
+ </Trigger >
84
+ <Trigger Property =" TickPlacement" Value =" Both" >
85
+ <Setter Property =" Visibility" TargetName =" PART_TopTick" Value =" Visible" />
86
+ <Setter Property =" Visibility" TargetName =" PART_BottomTick" Value =" Visible" />
87
+ </Trigger >
88
+ </ControlTemplate .Triggers>
89
+ </ControlTemplate >
90
+
91
+ <ControlTemplate x : Key =" MaterialDesignRangeSliderVertical"
92
+ TargetType =" controls:RangeSlider" >
93
+ <StackPanel Name =" PART_Container"
94
+ Orientation =" Horizontal"
95
+ HorizontalAlignment =" Center"
96
+ VerticalAlignment =" Stretch" >
97
+ <TickBar Name =" PART_TopTick"
98
+ Placement =" Left"
99
+ Fill =" {TemplateBinding Foreground}"
100
+ TickFrequency =" {TemplateBinding TickFrequency}"
101
+ Minimum =" {TemplateBinding Minimum}"
102
+ Maximum =" {TemplateBinding Maximum}"
103
+ Width =" 4"
104
+ Margin =" 0,5,2,5"
105
+ Visibility =" Collapsed" />
106
+ <StackPanel Orientation =" Vertical"
107
+ HorizontalAlignment =" Center"
108
+ VerticalAlignment =" Stretch"
109
+ Background =" Transparent"
110
+ Name =" PART_RangeSliderContainer"
111
+ Panel.ZIndex=" 1" >
112
+ <RepeatButton Name =" PART_RightEdge"
113
+ VerticalAlignment =" Stretch"
114
+ Background =" {DynamicResource MaterialDesignCheckBoxOff}"
115
+ Width =" 2"
116
+ Style =" {DynamicResource VerticalTrackLargeDecrease}" />
117
+ <Thumb Name =" PART_RightThumb"
118
+ Cursor =" Arrow"
119
+ Foreground =" {DynamicResource PrimaryHueMidBrush}"
120
+ Template =" {StaticResource MaterialDesignSliderThumb}"
121
+ Panel.ZIndex=" 1" />
122
+
123
+ <Thumb Name =" PART_MiddleThumb"
124
+ Cursor =" Hand"
125
+ MinHeight =" {TemplateBinding MinRangeWidth}" >
126
+ <Thumb .Style>
127
+ <Style TargetType =" Thumb" >
128
+ <Setter Property =" Template" >
129
+ <Setter .Value>
130
+ <ControlTemplate >
131
+ <Rectangle Width =" 2"
132
+ Margin =" 0,0,0,0"
133
+ Fill =" {DynamicResource PrimaryHueMidBrush}" />
134
+ </ControlTemplate >
135
+ </Setter .Value>
136
+ </Setter >
137
+ </Style >
138
+ </Thumb .Style>
139
+ </Thumb >
140
+
141
+ <Thumb Name =" PART_LeftThumb"
142
+ Cursor =" Arrow"
143
+ Foreground =" {DynamicResource PrimaryHueMidBrush}"
144
+ Template =" {StaticResource MaterialDesignSliderThumb}"
145
+ Panel.ZIndex=" 1" />
146
+ <RepeatButton Name =" PART_LeftEdge"
147
+ Width =" 2"
148
+ Background =" {DynamicResource MaterialDesignCheckBoxOff}"
149
+ Style =" {DynamicResource VerticalTrackLargeDecrease}" />
150
+ </StackPanel >
151
+ <TickBar Name =" PART_BottomTick"
152
+ Fill =" {TemplateBinding Foreground}"
153
+ TickFrequency =" {TemplateBinding TickFrequency}"
154
+ Minimum =" {TemplateBinding Minimum}"
155
+ Maximum =" {TemplateBinding Maximum}"
156
+ Placement =" Right"
157
+ Width =" 4"
158
+ Margin =" 2,5,0,5"
159
+ Visibility =" Collapsed" />
160
+ </StackPanel >
161
+ <ControlTemplate .Triggers>
162
+ <Trigger Property =" TickPlacement"
163
+ Value =" TopLeft" >
164
+ <Setter Property =" Visibility"
165
+ TargetName =" PART_TopTick"
166
+ Value =" Visible" />
167
+ </Trigger >
168
+ <Trigger Property =" TickPlacement"
169
+ Value =" BottomRight" >
170
+ <Setter Property =" Visibility"
171
+ TargetName =" PART_BottomTick"
172
+ Value =" Visible" />
173
+ </Trigger >
174
+ <Trigger Property =" TickPlacement"
175
+ Value =" Both" >
176
+ <Setter Property =" Visibility"
177
+ TargetName =" PART_TopTick"
178
+ Value =" Visible" />
179
+ <Setter Property =" Visibility"
180
+ TargetName =" PART_BottomTick"
181
+ Value =" Visible" />
182
+ </Trigger >
183
+ </ControlTemplate .Triggers>
184
+ </ControlTemplate >
185
+
186
+ <Style TargetType =" {x:Type controls:RangeSlider}" x : Key =" MaterialDesignRangeSlider" >
187
+ <Setter Property =" Background" Value =" Transparent" />
188
+ <Setter Property =" Template" Value =" {StaticResource MaterialDesignMahAppsRangeSliderHorizontal}" />
189
+ <Style .Triggers>
190
+ <Trigger Property =" Orientation" Value =" Vertical" >
191
+ <Setter Property =" Template" Value =" {StaticResource MaterialDesignRangeSliderVertical}" />
192
+ </Trigger >
193
+ </Style .Triggers>
194
+ </Style >
195
+
196
+ </ResourceDictionary >
0 commit comments