<ContentDialog
    x:Class="CharacterMap.Controls.OpenFolderDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:core="using:CharacterMap.Core"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    x:Uid="DigOpenFolder"
    CornerRadius="{StaticResource PopupCornerRadius}"
    IsPrimaryButtonEnabled="{x:Bind TemplateSettings.CanContinue, Mode=OneWay}"
    PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
    PrimaryButtonStyle="{StaticResource DefaultThemeButtonStyle}"
    SecondaryButtonStyle="{StaticResource DefaultThemeButtonStyle}"
    SecondaryButtonText="{core:Localizer Key=Cancel}"
    Style="{StaticResource DefaultThemeContentDialogStyle}"
    mc:Ignorable="d"
    d:PrimaryButtonText="{core:Localizer Key=DigOpenFolder/PrimaryButtonText}"
    d:Title="{core:Localizer Key=DigOpenFolder/Title}">

    <Grid>

        <StackPanel
            x:Name="LoadingRoot"
            x:Load="{x:Bind TemplateSettings.IsLoading, Mode=OneWay, FallbackValue=False}"
            MinWidth="500"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Spacing="24"
            d:Visibility="Collapsed">
            <muxc:ProgressRing
                Width="64"
                Height="64"
                Margin="0 24 0 0"
                Background="Transparent"
                Foreground="{ThemeResource ApplicationForegroundThemeBrush}"
                IsActive="True" />
            <!--<TextBlock
                HorizontalAlignment="Center"
                Style="{StaticResource TitleTextStyle}"
                Text="{core:Localizer Key=TxtLoadingFonts/Text, Casing={StaticResource TitleCasing}}" />-->
            <TextBlock
                HorizontalAlignment="Center"
                Style="{StaticResource TitleTextStyle}"
                Text="{core:Localizer Key=DigOpenFolderContent/FindingFontsLabel, Casing={StaticResource TitleCasing}}" />

            <TextBlock Margin="0 -8 0 0" HorizontalAlignment="Center">
                <Run Text="{core:Localizer Key=DigOpenFolderContent/PrefixLabel}" />
                <Run Text="{x:Bind TemplateSettings.Count, Mode=OneWay}" d:Text="11" />
                <Run Text="{core:Localizer Key=DigOpenFolderContent/SuffixLabel}" />
            </TextBlock>
        </StackPanel>

        <StackPanel
            x:Name="EntryRoot"
            x:Load="{x:Bind core:Converters.False(TemplateSettings.IsLoading), Mode=OneWay, FallbackValue=True}"
            d:Visibility="Visible">
            <TextBlock FontWeight="SemiBold" Text="{core:Localizer Key=DigOpenFolderContent/SelectHeader}" />
            <Button
                Margin="0 4 0 0"
                Click="{x:Bind PickFolderClick}"
                Content="{x:Bind TemplateSettings.Contents, Mode=OneWay}"
                d:Content="{core:Localizer Key=DigOpenFolderContent/SelectFolderButtonContent}" />

            <TextBlock
                Margin="0 24 0 0"
                FontWeight="SemiBold"
                Text="{core:Localizer Key=DigOpenFolderContent/FindHeader}" />
            <TextBlock Style="{StaticResource DescriptionStyle}" Text="{core:Localizer Key=DigOpenFolderContent/FindDescription}" />
            <CheckBox Content="{core:Localizer Key=DigOpenFolderContent/CheckRecursiveContent}" IsChecked="{x:Bind TemplateSettings.AllowRecursive, Mode=TwoWay}" />
            <CheckBox Content="{core:Localizer Key=DigOpenFolderContent/CheckZipContent}" IsChecked="{x:Bind TemplateSettings.AllowZip, Mode=TwoWay}" />
        </StackPanel>
    </Grid>

</ContentDialog>
