<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">

    <Style
        x:Key="PrimaryToggleButton"
        BasedOn="{StaticResource MaterialDesignSwitchToggleButton}"
        TargetType="{x:Type ToggleButton}">
        <Setter Property="materialDesign:ToggleButtonAssist.SwitchTrackOffBackground" Value="Gray" />
        <Style.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource PrimaryHueMidBrush}" />
                <Setter Property="materialDesign:ToggleButtonAssist.SwitchTrackOnBackground" Value="{DynamicResource PrimaryHueDarkBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>