@ -36,43 +36,10 @@
<x:Double x:Key="ToggleSwitchThemeMinWidth">0</x:Double>
<x:Double x:Key="ToggleSwitchThemeMinWidth">0</x:Double>
<Thickness x:Key="ToggleSwitchOnStrokeThickness">0</Thickness>
<Thickness x:Key="ToggleSwitchOnStrokeThickness">0</Thickness>
<Thickness x:Key="ToggleSwitchOuterBorderStrokeThickness">1</Thickness>
<Thickness x:Key="ToggleSwitchOuterBorderStrokeThickness">1</Thickness>
<SolidColorBrush x:Key="ToggleSwitchContentForeground" Color="{DynamicResource ThemeForegroundColor}" />
<SolidColorBrush x:Key="ToggleSwitchContentForegroundDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
<SolidColorBrush x:Key="ToggleSwitchHeaderForeground" Color="{DynamicResource ThemeForegroundColor}" />
<SolidColorBrush x:Key="ToggleSwitchHeaderForegroundDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
<SolidColorBrush x:Key="ToggleSwitchContainerBackground" Color="Transparent" />
<SolidColorBrush x:Key="ToggleSwitchContainerBackgroundPointerOver" Color="Transparent" />
<SolidColorBrush x:Key="ToggleSwitchContainerBackgroundPressed" Color="Transparent" />
<SolidColorBrush x:Key="ToggleSwitchContainerBackgroundDisabled" Color="Transparent" />
<SolidColorBrush x:Key="ToggleSwitchFillOff" Color="Transparent" />
<SolidColorBrush x:Key="ToggleSwitchFillOffPointerOver" Color="Transparent" />
<SolidColorBrush x:Key="ToggleSwitchFillOffPressed" Color="{DynamicResource ThemeControlMidHighColor}" />
<SolidColorBrush x:Key="ToggleSwitchFillOffDisabled" Color="Transparent" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOff" Color="{DynamicResource ThemeBorderMidColor}" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOffPointerOver" Color="{DynamicResource ThemeBorderHighColor}" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOffPressed" Color="{DynamicResource ThemeBorderHighColor}" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOffDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
<SolidColorBrush x:Key="ToggleSwitchFillOn" Color="{DynamicResource ThemeAccentColor}" />
<SolidColorBrush x:Key="ToggleSwitchFillOnPointerOver" Color="{DynamicResource ThemeAccentColor2}" />
<SolidColorBrush x:Key="ToggleSwitchFillOnPressed" Color="{DynamicResource ThemeAccentColor3}" />
<SolidColorBrush x:Key="ToggleSwitchFillOnDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOn" Color="{DynamicResource ThemeAccentColor}" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOnPointerOver" Color="{DynamicResource ThemeAccentColor2}" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOnPressed" Color="{DynamicResource ThemeAccentColor3}" />
<SolidColorBrush x:Key="ToggleSwitchStrokeOnDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOff" Color="{DynamicResource ThemeBorderMidColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOffPointerOver" Color="{DynamicResource ThemeBorderHighColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOffPressed" Color="{DynamicResource ThemeBorderHighColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOffDisabled" Color="{DynamicResource ThemeForegroundLowColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOn" Color="{DynamicResource HighlightForegroundColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOnPointerOver" Color="{DynamicResource HighlightForegroundColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOnPressed" Color="{DynamicResource HighlightForegroundColor}" />
<SolidColorBrush x:Key="ToggleSwitchKnobFillOnDisabled" Color="{DynamicResource HighlightForegroundColor}" />
<ControlTheme x:Key="{x:Type ToggleSwitch}"
<ControlTheme x:Key="{x:Type ToggleSwitch}"
TargetType="ToggleSwitch">
TargetType="ToggleSwitch">
<Setter Property="Foreground" Value="{DynamicResource ToggleSwitchContentForeground }" />
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
@ -111,7 +78,7 @@
<Grid x:Name="SwitchAreaGrid"
<Grid x:Name="SwitchAreaGrid"
Grid.RowSpan="3"
Grid.RowSpan="3"
Grid.ColumnSpan="3"
Grid.ColumnSpan="3"
Background="{DynamicResource ToggleSwitchContainerBackground} "
Background="Transparent "
TemplatedControl.IsTemplateFocusTarget="True"
TemplatedControl.IsTemplateFocusTarget="True"
Margin="0,5" />
Margin="0,5" />
@ -136,8 +103,8 @@
Height="20"
Height="20"
Width="40"
Width="40"
CornerRadius="10"
CornerRadius="10"
Background="{DynamicResource ToggleSwitchFillOff} "
Background="Transparent "
BorderBrush="{DynamicResource ToggleSwitchStrokeOff }"
BorderBrush="{DynamicResource ThemeBorderMidColor }"
BorderThickness="{DynamicResource ToggleSwitchOuterBorderStrokeThickness}" />
BorderThickness="{DynamicResource ToggleSwitchOuterBorderStrokeThickness}" />
<Border x:Name="SwitchKnobBounds"
<Border x:Name="SwitchKnobBounds"
@ -145,8 +112,8 @@
Height="20"
Height="20"
Width="40"
Width="40"
CornerRadius="10"
CornerRadius="10"
Background="{DynamicResource ToggleSwitchFillOn }"
Background="{DynamicResource ThemeAccentColor }"
BorderBrush="{DynamicResource ToggleSwitchStrokeOn }"
BorderBrush="{DynamicResource ThemeAccentColor }"
BorderThickness="{DynamicResource ToggleSwitchOnStrokeThickness}" />
BorderThickness="{DynamicResource ToggleSwitchOnStrokeThickness}" />
<Canvas x:Name="PART_SwitchKnob" Grid.Row="1"
<Canvas x:Name="PART_SwitchKnob" Grid.Row="1"
@ -162,11 +129,11 @@
</Grid.Transitions>
</Grid.Transitions>
<Ellipse x:Name="SwitchKnobOn"
<Ellipse x:Name="SwitchKnobOn"
Fill="{DynamicResource ToggleSwitchKnobFillOn }"
Fill="{DynamicResource HighlightForegroundColor }"
Width="10" Height="10" />
Width="10" Height="10" />
<Ellipse x:Name="SwitchKnobOff"
<Ellipse x:Name="SwitchKnobOff"
Fill="{DynamicResource ToggleSwitchKnobFillOff }"
Fill="{DynamicResource ThemeBorderMidColor }"
Width="10" Height="10" />
Width="10" Height="10" />
</Grid>
</Grid>
</Canvas>
</Canvas>
@ -181,71 +148,71 @@
<!-- PointerOverState -->
<!-- PointerOverState -->
<Style Selector="^:pointerover /template/ Border#OuterBorder">
<Style Selector="^:pointerover /template/ Border#OuterBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffPointerOve r}" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighColo r}" />
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffPointerOver} " />
<Setter Property="Background" Value="Transparent " />
</Style>
</Style>
<Style Selector="^:pointerover /template/ Ellipse#SwitchKnobOff">
<Style Selector="^:pointerover /template/ Ellipse#SwitchKnobOff">
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffPointerOve r}" />
<Setter Property="Fill" Value="{DynamicResource ThemeBorderHighColo r}" />
</Style>
</Style>
<Style Selector="^:pointerover /template/ Ellipse#SwitchKnobOn">
<Style Selector="^:pointerover /template/ Ellipse#SwitchKnobOn">
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnPointerOve r}" />
<Setter Property="Fill" Value="{DynamicResource HighlightForegroundColo r}" />
</Style>
</Style>
<Style Selector="^:pointerover /template/ Border#SwitchKnobBounds">
<Style Selector="^:pointerover /template/ Border#SwitchKnobBounds">
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnPointerOver }" />
<Setter Property="Background" Value="{DynamicResource ThemeAccentColor2 }" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnPointerOver }" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeAccentColor2 }" />
</Style>
</Style>
<Style Selector="^:pointerover /template/ Grid#SwitchAreaGrid">
<Style Selector="^:pointerover /template/ Grid#SwitchAreaGrid">
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackgroundPointerOver} " />
<Setter Property="Background" Value="Transparent " />
</Style>
</Style>
<!-- PressedState -->
<!-- PressedState -->
<Style Selector="^:pressed /template/ Border#OuterBorder">
<Style Selector="^:pressed /template/ Border#OuterBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffPressed }" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighColor }" />
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffPressed }" />
<Setter Property="Background" Value="{DynamicResource ThemeControlMidHighColor }" />
</Style>
</Style>
<Style Selector="^:pressed /template/ Border#SwitchKnobBounds">
<Style Selector="^:pressed /template/ Border#SwitchKnobBounds">
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnPressed }" />
<Setter Property="Background" Value="{DynamicResource ThemeAccentColor3 }" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnPressed }" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeAccentColor3 }" />
</Style>
</Style>
<Style Selector="^:pressed /template/ Ellipse#SwitchKnobOff">
<Style Selector="^:pressed /template/ Ellipse#SwitchKnobOff">
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffPressed }" />
<Setter Property="Fill" Value="{DynamicResource ThemeBorderHighColor }" />
</Style>
</Style>
<Style Selector="^:pressed /template/ Ellipse#SwitchKnobOn">
<Style Selector="^:pressed /template/ Ellipse#SwitchKnobOn">
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnPressed }" />
<Setter Property="Fill" Value="{DynamicResource HighlightForegroundColor }" />
</Style>
</Style>
<Style Selector="^:pressed /template/ Grid#SwitchAreaGrid">
<Style Selector="^:pressed /template/ Grid#SwitchAreaGrid">
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackgroundPressed} " />
<Setter Property="Background" Value="Transparent " />
</Style>
</Style>
<!-- DisabledState -->
<!-- DisabledState -->
<Style Selector="^:disabled">
<Style Selector="^:disabled">
<Setter Property="Foreground" Value="{DynamicResource ToggleSwitchHeaderForegroundDisabled }" />
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundLowColor }" />
</Style>
</Style>
<Style Selector="^:disabled /template/ Border#OuterBorder">
<Style Selector="^:disabled /template/ Border#OuterBorder">
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffDisabled }" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeForegroundLowColor }" />
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffDisabled} " />
<Setter Property="Background" Value="Transparent " />
</Style>
</Style>
<Style Selector="^:disabled /template/ Ellipse#SwitchKnobOff">
<Style Selector="^:disabled /template/ Ellipse#SwitchKnobOff">
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffDisabled }" />
<Setter Property="Fill" Value="{DynamicResource ThemeForegroundLowColor }" />
</Style>
</Style>
<Style Selector="^:disabled /template/ Ellipse#SwitchKnobOn">
<Style Selector="^:disabled /template/ Ellipse#SwitchKnobOn">
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnDisabled }" />
<Setter Property="Fill" Value="{DynamicResource HighlightForegroundColor }" />
</Style>
</Style>
<Style Selector="^:disabled /template/ Border#SwitchKnobBounds">
<Style Selector="^:disabled /template/ Border#SwitchKnobBounds">
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnDisabled }" />
<Setter Property="Background" Value="{DynamicResource ThemeForegroundLowColor }" />
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnDisabled }" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeForegroundLowColor }" />
</Style>
</Style>
<!-- CheckedState -->
<!-- CheckedState -->