177
177
<Setter Property =" Foreground" Value =" {DynamicResource SecondaryAccentForegroundBrush}" />
178
178
</Style >
179
179
180
- <Style x : Key =" MaterialDesignFlatToggleButton" TargetType =" {x:Type ToggleButton}" >
180
+ <Style x : Key =" MaterialDesignFlatToggleButton" TargetType =" {x:Type ToggleButton}" >
181
181
<Setter Property =" Foreground" Value =" #616161" />
182
182
<Setter Property =" Background" Value =" #e0e0e0" />
183
183
<Setter Property =" Width" Value =" 40" />
189
189
<Setter Property =" Template" >
190
190
<Setter .Value>
191
191
<ControlTemplate TargetType =" {x:Type ToggleButton}" >
192
- <Grid Clip = " {Binding ElementName=UncheckedEllipse, Path=RenderedGeometry }" ClipToBounds = " True " >
192
+ <Grid ClipToBounds = " True " Width = " {TemplateBinding Width }" Height = " {TemplateBinding Height} " >
193
193
<VisualStateManager .VisualStateGroups>
194
194
<VisualStateGroup x : Name =" CommonStates" >
195
195
<VisualState x : Name =" Normal" />
196
196
<VisualState x : Name =" Disabled" >
197
197
<Storyboard >
198
198
<DoubleAnimation Duration =" 0" To =" 0.23" Storyboard.TargetProperty=" (UIElement.Opacity)" />
199
199
</Storyboard >
200
- </VisualState >
200
+ </VisualState >
201
201
</VisualStateGroup >
202
202
<VisualStateGroup x : Name =" CheckStates" >
203
- <VisualStateGroup .Transitions>
204
- <VisualTransition From =" *" To =" Checked" >
205
- <Storyboard >
206
- <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" (Control.Width) " Storyboard.TargetName=" CheckedEllipse " >
207
- <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.0" />
208
- <LinearDoubleKeyFrame Value =" 40 " KeyTime =" 0:0:0.1" />
209
- </DoubleAnimationUsingKeyFrames >
210
- <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" (Control.Height) " Storyboard.TargetName=" CheckedEllipse " >
211
- <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.0" />
212
- <LinearDoubleKeyFrame Value =" 40 " KeyTime =" 0:0:0.1" />
213
- </DoubleAnimationUsingKeyFrames >
214
- </Storyboard >
215
- </VisualTransition >
216
- <VisualTransition From =" Checked" To =" Unchecked" >
217
- <Storyboard >
218
- <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" (Control.Width) " Storyboard.TargetName=" CheckedEllipse " >
219
- <LinearDoubleKeyFrame Value =" 40 " KeyTime =" 0:0:0.0" />
220
- <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.1" />
221
- </DoubleAnimationUsingKeyFrames >
222
- <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" (Control.Height) " Storyboard.TargetName=" CheckedEllipse " >
223
- <LinearDoubleKeyFrame Value =" 40 " KeyTime =" 0:0:0.0" />
224
- <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.1" />
225
- </DoubleAnimationUsingKeyFrames >
226
- </Storyboard >
227
- </VisualTransition >
228
- </VisualStateGroup .Transitions>
203
+ <VisualStateGroup .Transitions>
204
+ <VisualTransition From =" *" To =" Checked" >
205
+ <Storyboard >
206
+ <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" ScaleX " Storyboard.TargetName=" CheckedEllipseScale " >
207
+ <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.0" />
208
+ <LinearDoubleKeyFrame Value =" 1.0 " KeyTime =" 0:0:0.1" />
209
+ </DoubleAnimationUsingKeyFrames >
210
+ <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" ScaleY " Storyboard.TargetName=" CheckedEllipseScale " >
211
+ <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.0" />
212
+ <LinearDoubleKeyFrame Value =" 1.0 " KeyTime =" 0:0:0.1" />
213
+ </DoubleAnimationUsingKeyFrames >
214
+ </Storyboard >
215
+ </VisualTransition >
216
+ <VisualTransition From =" Checked" To =" Unchecked" >
217
+ <Storyboard >
218
+ <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" ScaleX " Storyboard.TargetName=" CheckedEllipseScale " >
219
+ <LinearDoubleKeyFrame Value =" 1.0 " KeyTime =" 0:0:0.0" />
220
+ <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.1" />
221
+ </DoubleAnimationUsingKeyFrames >
222
+ <DoubleAnimationUsingKeyFrames Duration =" 0:0:0.2" Storyboard.TargetProperty=" ScaleY " Storyboard.TargetName=" CheckedEllipseScale " >
223
+ <LinearDoubleKeyFrame Value =" 1.0 " KeyTime =" 0:0:0.0" />
224
+ <LinearDoubleKeyFrame Value =" 0" KeyTime =" 0:0:0.1" />
225
+ </DoubleAnimationUsingKeyFrames >
226
+ </Storyboard >
227
+ </VisualTransition >
228
+ </VisualStateGroup .Transitions>
229
229
<VisualState x : Name =" Checked" >
230
230
<Storyboard >
231
- <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" (Control.Width)" Storyboard.TargetName=" CheckedEllipse"
232
- To =" 40" />
233
- <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" (Control.Height)" Storyboard.TargetName=" CheckedEllipse"
234
- To =" 40" />
231
+ <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" ScaleX" Storyboard.TargetName=" CheckedEllipseScale" To =" 1.0" />
232
+ <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" ScaleY" Storyboard.TargetName=" CheckedEllipseScale" To =" 1.0" />
235
233
</Storyboard >
236
234
</VisualState >
237
235
<VisualState x : Name =" Unchecked" >
238
236
<Storyboard >
239
- <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" (Control.Width)" Storyboard.TargetName=" CheckedEllipse"
240
- To =" 0" />
241
- <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" (Control.Height)" Storyboard.TargetName=" CheckedEllipse"
242
- To =" 0" />
237
+ <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" ScaleX" Storyboard.TargetName=" CheckedEllipseScale" To =" 0" />
238
+ <DoubleAnimation Duration =" 0" Storyboard.TargetProperty=" ScaleY" Storyboard.TargetName=" CheckedEllipseScale" To =" 0" />
243
239
</Storyboard >
244
240
</VisualState >
245
241
</VisualStateGroup >
246
242
</VisualStateManager .VisualStateGroups>
247
- <Ellipse Fill =" Transparent" Width =" {TemplateBinding Width}" Height =" {TemplateBinding Height}" x : Name =" HoverEllipse"
248
- Stroke =" Transparent" StrokeThickness =" 1" />
249
- <Ellipse Fill =" {TemplateBinding Background}" Width =" {TemplateBinding Width}" Height =" {TemplateBinding Height}" x : Name =" CheckedEllipse" />
243
+ <Ellipse Fill =" Transparent" x : Name =" HoverEllipse" Stroke =" Transparent" StrokeThickness =" 1" />
244
+ <Ellipse Fill =" {TemplateBinding Background}" x : Name =" CheckedEllipse" RenderTransformOrigin =" 0.5, 0.5" >
245
+ <Ellipse .RenderTransform>
246
+ <ScaleTransform CenterX =" 0.5" CenterY =" 0.5" ScaleX =" 1.0" ScaleY =" 1.0" x : Name =" CheckedEllipseScale" />
247
+ </Ellipse .RenderTransform>
248
+ </Ellipse >
250
249
<ContentPresenter x : Name =" contentPresenter" ContentTemplate =" {TemplateBinding ContentTemplate}" Content =" {TemplateBinding Content}" HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}" Margin =" {TemplateBinding Padding}" VerticalAlignment =" {TemplateBinding VerticalContentAlignment}" />
251
250
</Grid >
252
251
<ControlTemplate .Triggers>
253
- <Trigger Property =" IsMouseOver" Value =" true" >
254
- <Setter Property =" Stroke" TargetName =" HoverEllipse" Value =" {Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" />
252
+ <Trigger Property =" IsMouseOver" Value =" true" >
253
+ <Setter Property =" Stroke" TargetName =" HoverEllipse" Value =" {Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" />
254
+ </Trigger >
255
+ <!-- TODO
256
+ <Trigger Property="IsFocused" Value="True">
257
+ <Setter Property="BorderBrush" TargetName="normal" Value="{Binding (Custom:ControlsHelper.FocusBorderBrush), RelativeSource={RelativeSource TemplatedParent}}"/>
255
258
</Trigger>
256
- <!-- TODO
257
- <Trigger Property="IsFocused" Value="True">
258
- <Setter Property="BorderBrush" TargetName="normal" Value="{Binding (Custom:ControlsHelper.FocusBorderBrush), RelativeSource={RelativeSource TemplatedParent}}"/>
259
- </Trigger>
260
- -->
261
- </ControlTemplate .Triggers>
262
- </ControlTemplate >
263
- </Setter .Value>
259
+ -->
260
+ </ControlTemplate .Triggers>
261
+ </ControlTemplate >
262
+ </Setter .Value>
264
263
</Setter >
265
- </Style >
266
-
267
- <Style x : Key =" MaterialDesignFlatPrimaryToggleButton" TargetType =" {x:Type ToggleButton}" BasedOn =" {StaticResource MaterialDesignFlatToggleButton}" >
264
+ </Style >
265
+
266
+ <Style x : Key =" MaterialDesignFlatPrimaryToggleButton" TargetType =" {x:Type ToggleButton}" BasedOn =" {StaticResource MaterialDesignFlatToggleButton}" >
268
267
<Setter Property =" Background" Value =" {DynamicResource PrimaryHueLightBrush}" />
269
268
<Setter Property =" Foreground" Value =" {DynamicResource PrimaryHueDarkBrush}" />
270
269
</Style >
576
575
</Setter >
577
576
</Style >
578
577
579
- </ResourceDictionary >
578
+ </ResourceDictionary >
0 commit comments