|
28 | 28 | </Style> |
29 | 29 |
|
30 | 30 | <ControlTemplate x:Key="MaterialDesignSliderThumb" TargetType="{x:Type Thumb}"> |
31 | | - <ControlTemplate.Resources> |
32 | | - <Storyboard x:Key="ShowFocusVisualStoryboard"> |
33 | | - <DoubleAnimation Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="Opacity" To="0.15" Duration="0" /> |
34 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"> |
35 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0" /> |
36 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"> |
37 | | - <EasingDoubleKeyFrame.EasingFunction> |
38 | | - <SineEase EasingMode="EaseInOut" /> |
39 | | - </EasingDoubleKeyFrame.EasingFunction> |
40 | | - </EasingDoubleKeyFrame> |
41 | | - </DoubleAnimationUsingKeyFrames> |
42 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"> |
43 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0" /> |
44 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"> |
45 | | - <EasingDoubleKeyFrame.EasingFunction> |
46 | | - <SineEase EasingMode="EaseInOut" /> |
47 | | - </EasingDoubleKeyFrame.EasingFunction> |
48 | | - </EasingDoubleKeyFrame> |
49 | | - </DoubleAnimationUsingKeyFrames> |
50 | | - </Storyboard> |
51 | | - <Storyboard x:Key="HideFocusVisualStoryboard"> |
52 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="Opacity"> |
53 | | - <EasingDoubleKeyFrame KeyTime="0:0:0" Value="0.15" /> |
54 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"> |
55 | | - <EasingDoubleKeyFrame.EasingFunction> |
56 | | - <SineEase EasingMode="EaseInOut" /> |
57 | | - </EasingDoubleKeyFrame.EasingFunction> |
58 | | - </EasingDoubleKeyFrame> |
59 | | - </DoubleAnimationUsingKeyFrames> |
60 | | - <DoubleAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"> |
61 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" /> |
62 | | - </DoubleAnimationUsingKeyFrames> |
63 | | - <DoubleAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="focusedHalo" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"> |
64 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" /> |
65 | | - </DoubleAnimationUsingKeyFrames> |
66 | | - </Storyboard> |
67 | | - </ControlTemplate.Resources> |
68 | | - <Grid x:Name="thumbGrid" Height="16" Width="14"> |
69 | | - <Ellipse |
70 | | - x:Name="halo" |
71 | | - Width="32" |
72 | | - Height="32" |
73 | | - Margin="-24" |
74 | | - Fill="{TemplateBinding Foreground}" |
75 | | - Opacity="0" /> |
76 | | - <Ellipse |
77 | | - x:Name="focusedHalo" |
78 | | - Width="32" |
79 | | - Height="32" |
80 | | - Margin="-24" |
81 | | - Fill="{TemplateBinding Foreground}" |
82 | | - Opacity="0.15" |
83 | | - RenderTransformOrigin="0.5,0.5"> |
84 | | - <Ellipse.RenderTransform> |
85 | | - <ScaleTransform ScaleX="0" ScaleY="0" /> |
86 | | - </Ellipse.RenderTransform> |
87 | | - </Ellipse> |
| 31 | + <Grid x:Name="thumbGrid" Height="10" Width="8"> |
88 | 32 | <AdornerDecorator> |
89 | 33 | <AdornerDecorator.CacheMode> |
90 | 34 | <BitmapCache SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
91 | 35 | </AdornerDecorator.CacheMode> |
92 | 36 | <Ellipse |
93 | 37 | x:Name="grip" |
94 | | - Fill="{TemplateBinding Foreground}" |
| 38 | + Fill="{DynamicResource MaterialDesignBody}" |
95 | 39 | Effect="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Slider}, Path=(wpf:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}" |
96 | 40 | Margin="-1,0" /> |
97 | 41 | </AdornerDecorator> |
98 | 42 | </Grid> |
99 | | - <ControlTemplate.Triggers> |
100 | | - <DataTrigger Binding="{Binding Orientation, RelativeSource={RelativeSource FindAncestor, AncestorType=Track}}" Value="{x:Static Orientation.Vertical}"> |
101 | | - <Setter TargetName="thumbGrid" Property="Height" Value="18" /> |
102 | | - <Setter TargetName="thumbGrid" Property="Width" Value="20" /> |
103 | | - <Setter TargetName="grip" Property="Margin" Value="0,-1" /> |
104 | | - </DataTrigger> |
105 | | - <Trigger Property="IsMouseOver" Value="true"> |
106 | | - <Trigger.EnterActions> |
107 | | - <BeginStoryboard> |
108 | | - <Storyboard> |
109 | | - <DoubleAnimation Storyboard.TargetName="halo" Storyboard.TargetProperty="Opacity" To="0.15" Duration="0:0:0.2" /> |
110 | | - </Storyboard> |
111 | | - </BeginStoryboard> |
112 | | - </Trigger.EnterActions> |
113 | | - <Trigger.ExitActions> |
114 | | - <BeginStoryboard> |
115 | | - <Storyboard> |
116 | | - <DoubleAnimation Storyboard.TargetName="halo" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.2" /> |
117 | | - </Storyboard> |
118 | | - </BeginStoryboard> |
119 | | - </Trigger.ExitActions> |
120 | | - </Trigger> |
121 | | - <DataTrigger Value="True"> |
122 | | - <DataTrigger.Binding> |
123 | | - <MultiBinding Converter="{StaticResource BooleanAllConverter}"> |
124 | | - <Binding Path="IsFocused" RelativeSource="{RelativeSource FindAncestor, AncestorType=Slider}" /> |
125 | | - <Binding Path="(wpf:SliderAssist.OnlyShowFocusVisualWhileDragging)" RelativeSource="{RelativeSource FindAncestor, AncestorType=Slider}" Converter="{StaticResource InvertBooleanConverter}" /> |
126 | | - </MultiBinding> |
127 | | - </DataTrigger.Binding> |
128 | | - <DataTrigger.EnterActions> |
129 | | - <BeginStoryboard Storyboard="{StaticResource ShowFocusVisualStoryboard}" /> |
130 | | - </DataTrigger.EnterActions> |
131 | | - <DataTrigger.ExitActions> |
132 | | - <BeginStoryboard Storyboard="{StaticResource HideFocusVisualStoryboard}" /> |
133 | | - </DataTrigger.ExitActions> |
134 | | - </DataTrigger> |
135 | | - <DataTrigger Value="True"> |
136 | | - <DataTrigger.Binding> |
137 | | - <MultiBinding Converter="{StaticResource BooleanAllConverter}"> |
138 | | - <Binding Path="IsDragging" RelativeSource="{RelativeSource Self}" /> |
139 | | - <Binding Path="(wpf:SliderAssist.OnlyShowFocusVisualWhileDragging)" RelativeSource="{RelativeSource FindAncestor, AncestorType=Slider}" /> |
140 | | - </MultiBinding> |
141 | | - </DataTrigger.Binding> |
142 | | - <DataTrigger.EnterActions> |
143 | | - <BeginStoryboard Storyboard="{StaticResource ShowFocusVisualStoryboard}" /> |
144 | | - </DataTrigger.EnterActions> |
145 | | - <DataTrigger.ExitActions> |
146 | | - <BeginStoryboard Storyboard="{StaticResource HideFocusVisualStoryboard}" /> |
147 | | - </DataTrigger.ExitActions> |
148 | | - </DataTrigger> |
149 | | - </ControlTemplate.Triggers> |
150 | 43 | </ControlTemplate> |
151 | 44 |
|
152 | 45 | <ControlTemplate x:Key="MaterialDesignSliderHorizontal" TargetType="{x:Type Slider}"> |
|
164 | 57 | </Grid.RowDefinitions> |
165 | 58 | <TickBar x:Name="TopTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,0,0,2" Placement="Top" Grid.Row="0" Visibility="Collapsed" /> |
166 | 59 | <TickBar x:Name="BottomTick" Fill="{TemplateBinding Foreground}" Height="4" Margin="0,2,0,0" Placement="Bottom" Grid.Row="2" Visibility="Collapsed"/> |
167 | | - <Rectangle Grid.Row="1" Fill="{TemplateBinding Foreground}" Height="3" Opacity="0.38" VerticalAlignment="Center" RadiusX="2" RadiusY="2" /> |
| 60 | + <Rectangle Grid.Row="1" Fill="{TemplateBinding Foreground}" Height="6" Opacity="0.38" VerticalAlignment="Center" RadiusX="2" RadiusY="2" /> |
168 | 61 | <Border |
169 | 62 | x:Name="activeTrack" |
170 | 63 | Grid.Row="1" |
171 | 64 | Background="{TemplateBinding Foreground}" |
172 | 65 | CornerRadius="3,0,0,3" |
173 | | - Height="4" |
| 66 | + Height="7" |
174 | 67 | Width="{Binding DecreaseRepeatButton.ActualWidth, ElementName=PART_Track}" |
175 | 68 | HorizontalAlignment="Left" |
176 | 69 | VerticalAlignment="Center" /> |
|
0 commit comments