|
|
|
@ -6,8 +6,40 @@ |
|
|
|
<GridLength x:Key="ToggleSwitchPreContentMargin">6</GridLength> |
|
|
|
<GridLength x:Key="ToggleSwitchPostContentMargin">6</GridLength> |
|
|
|
<x:Double x:Key="ToggleSwitchThemeMinWidth">154</x:Double> |
|
|
|
<x:Double x:Key="KnobOnPosition">20</x:Double> |
|
|
|
<x:Double x:Key="KnobOffPosition">0</x:Double> |
|
|
|
<Thickness x:Key="ToggleSwitchOnStrokeThickness">0</Thickness> |
|
|
|
<Thickness x:Key="ToggleSwitchOuterBorderStrokeThickness">1</Thickness> |
|
|
|
<StaticResource x:Key="ToggleSwitchContentForeground" ResourceKey="ThemeForegroundBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchContentForegroundDisabled" ResourceKey="ThemeForegroundLowBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchHeaderForeground" ResourceKey="ThemeForegroundBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchHeaderForegroundDisabled" ResourceKey="ThemeForegroundLowBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchContainerBackground" ResourceKey="ThemeControlTransparentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchContainerBackgroundPointerOver" ResourceKey="ThemeControlTransparentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchContainerBackgroundPressed" ResourceKey="ThemeControlTransparentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchContainerBackgroundDisabled" ResourceKey="ThemeControlTransparentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOff" ResourceKey="ThemeControlTransparentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOffPointerOver" ResourceKey="ThemeControlTransparentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOffPressed" ResourceKey="ThemeControlMidHighBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOffDisabled" ResourceKey="ThemeControlTransparentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOff" ResourceKey="ThemeBorderMidBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOffPointerOver" ResourceKey="ThemeBorderHighBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOffPressed" ResourceKey="ThemeBorderHighBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOffDisabled" ResourceKey="ThemeForegroundLowBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOn" ResourceKey="ThemeAccentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOnPointerOver" ResourceKey="ThemeAccentBrush2" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOnPressed" ResourceKey="ThemeAccentBrush3" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchFillOnDisabled" ResourceKey="ThemeForegroundLowBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOn" ResourceKey="ThemeAccentBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOnPointerOver" ResourceKey="ThemeAccentBrush2" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOnPressed" ResourceKey="ThemeAccentBrush3" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchStrokeOnDisabled" ResourceKey="ThemeForegroundLowBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOff" ResourceKey="ThemeBorderMidBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOffPointerOver" ResourceKey="ThemeBorderHighBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOffPressed" ResourceKey="ThemeBorderHighBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOffDisabled" ResourceKey="ThemeForegroundLowBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOn" ResourceKey="HighlightForegroundBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOnPointerOver" ResourceKey="HighlightForegroundBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOnPressed" ResourceKey="HighlightForegroundBrush" /> |
|
|
|
<StaticResource x:Key="ToggleSwitchKnobFillOnDisabled" ResourceKey="HighlightForegroundBrush" /> |
|
|
|
</Styles.Resources> |
|
|
|
<Design.PreviewWith> |
|
|
|
<StackPanel Margin="20" Width="250" Spacing="24" > |
|
|
|
@ -155,7 +187,6 @@ |
|
|
|
</Style> |
|
|
|
|
|
|
|
<Style Selector="ToggleSwitch /template/ Grid#MovingKnobs"> |
|
|
|
<Setter Property="Canvas.Left" Value="{DynamicResource KnobOffPosition}"/> |
|
|
|
<Setter Property="Transitions"> |
|
|
|
<Transitions> |
|
|
|
<DoubleTransition Property="Canvas.Left" Duration="0:0:0.2" Easing="CubicEaseOut"/> |
|
|
|
@ -233,10 +264,6 @@ |
|
|
|
</Style> |
|
|
|
|
|
|
|
<!-- CheckedState --> |
|
|
|
<Style Selector="ToggleSwitch:checked /template/ Grid#MovingKnobs"> |
|
|
|
<Setter Property="Canvas.Left" Value="{DynamicResource KnobOnPosition}"/> |
|
|
|
</Style> |
|
|
|
|
|
|
|
<Style Selector="ToggleSwitch:checked /template/ Border#OuterBorder"> |
|
|
|
<Setter Property="Opacity" Value="0"/> |
|
|
|
</Style> |
|
|
|
@ -262,10 +289,6 @@ |
|
|
|
</Style> |
|
|
|
|
|
|
|
<!--UncheckedState --> |
|
|
|
<Style Selector="ToggleSwitch:unchecked /template/ Grid#MovingKnobs"> |
|
|
|
<Setter Property="Canvas.Left" Value="{DynamicResource KnobOffPosition}"/> |
|
|
|
</Style> |
|
|
|
|
|
|
|
<Style Selector="ToggleSwitch:unchecked /template/ Border#OuterBorder"> |
|
|
|
<Setter Property="Opacity" Value="1"/> |
|
|
|
</Style> |
|
|
|
|