Resources/XAML/ResourceDictionaries/ConfirmationPageToggleButtonStyles.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Color x:Key="grayColor">#e0e0e0</Color>
    <Color x:Key="PurpleColour">#c471ed</Color>
    <SolidColorBrush x:Key="ConfirmationPageToggleButtonStyleBackgroundBrush" Color="{StaticResource grayColor}"/>
    <ControlTemplate x:Key="ConfirmationPageToggleButtonStyle" TargetType="{x:Type ToggleButton}">
        <Border x:Name="border"
              Background="{DynamicResource ConfirmationPageToggleButtonStyleBackgroundBrush}"
              CornerRadius="12.5"
            SnapsToDevicePixels="true">
            <Canvas Background="Transparent">
                <Ellipse x:Name="ellipse"
                       Fill="White"
                       Width="23.5" Height="23.5"
                    Canvas.Top="2" Canvas.Left="3"
 
                    SnapsToDevicePixels="True"/>
            </Canvas>
        </Border>
        <ControlTemplate.Triggers>
            <EventTrigger RoutedEvent="ToggleButton.Checked">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="ellipse"
                                       Storyboard.TargetProperty="(Canvas.Left)"
                                       From="3" To="48.5"
                            Duration="0:0:0.15"
                                       AutoReverse="False"/>
                        <ColorAnimation Storyboard.TargetName="border"
                                      Storyboard.TargetProperty="Background.Color"
                                      From="{StaticResource grayColor}" To="{StaticResource PurpleColour}" Duration="0:0:0.15"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
            <EventTrigger RoutedEvent="ToggleButton.Unchecked">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="ellipse"
                                       Storyboard.TargetProperty="(Canvas.Left)"
                                       From="48.5" To="3"
                            Duration="0:0:0.15"
                                       AutoReverse="False"/>
                        <ColorAnimation Storyboard.TargetName="border"
                                      Storyboard.TargetProperty="Background.Color"
                                      From="{StaticResource PurpleColour}" To="{StaticResource grayColor}" Duration="0:0:0.15"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
</ResourceDictionary>