<UserControl
    x:Name="Root"
    x:Class="ModernWpf.SampleApp.ThreadedUI.ThreadedProgressBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    mc:Ignorable="d">

    <UserControl.Resources>
        <SolidColorBrush x:Key="SystemControlHighlightAccentBrush" Color="{StaticResource SystemAccentColor}" />
        <SolidColorBrush x:Key="SystemControlBackgroundBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" />
        <SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="Transparent" />
    </UserControl.Resources>

    <ui:ProgressBar
        Width="130"
        IsIndeterminate="{Binding ElementName=Root, Path=IsIndeterminate}"
        ui:ThemeManager.HasThemeResources="True">
        <ui:ProgressBar.Resources>
            <ui:ResourceDictionaryEx>
                <ui:ResourceDictionaryEx.ThemeDictionaries>
                    <ResourceDictionary x:Key="HighContrast">
                        <SolidColorBrush x:Key="SystemControlBackgroundBaseLowBrush" Color="{ui:ThemeResource SystemColorButtonFaceColor}" />
                        <SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="{ui:ThemeResource SystemColorHighlightColor}" />
                    </ResourceDictionary>
                </ui:ResourceDictionaryEx.ThemeDictionaries>
            </ui:ResourceDictionaryEx>
        </ui:ProgressBar.Resources>
    </ui:ProgressBar>
</UserControl>
