<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:APKInstaller.Controls">
    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Default">
            <StaticResource x:Key="QRCodeForeground" ResourceKey="TextFillColorPrimaryBrush" />
        </ResourceDictionary>

        <ResourceDictionary x:Key="Light">
            <StaticResource x:Key="QRCodeForeground" ResourceKey="TextFillColorPrimaryBrush" />
        </ResourceDictionary>

        <ResourceDictionary x:Key="HighContrast">
            <StaticResource x:Key="SettingCardForeground" ResourceKey="SystemColorButtonTextColorBrush" />
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <Thickness x:Key="QRCodePadding">16,16,16,16</Thickness>
    <x:Double x:Key="QRCodeMinWidth">100</x:Double>
    <x:Double x:Key="QRCodeMinHeight">100</x:Double>

    <Style BasedOn="{StaticResource DefaultQRCodeStyle}" TargetType="controls:QRCode" />

    <Style x:Key="DefaultQRCodeStyle" TargetType="controls:QRCode">
        <Setter Property="Foreground" Value="{ThemeResource QRCodeForeground}" />
        <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
        <Setter Property="MinHeight" Value="{ThemeResource QRCodeMinHeight}" />
        <Setter Property="MinWidth" Value="{ThemeResource QRCodeMinWidth}" />
        <Setter Property="Padding" Value="{ThemeResource QRCodePadding}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:QRCode">
                    <Border
                        MinWidth="{TemplateBinding MinWidth}"
                        MinHeight="{TemplateBinding MinHeight}"
                        Padding="{TemplateBinding Padding}"
                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalAlignment}"
                        Background="{TemplateBinding Background}"
                        BackgroundSizing="{TemplateBinding BackgroundSizing}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{TemplateBinding CornerRadius}">
                        <Path
                            x:Name="PART_QRCodePath"
                            Data="{Binding TemplateSettings.GeometryGroup, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                            Fill="{TemplateBinding Foreground}"
                            StrokeThickness="0" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
