<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/BaseStyle.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/ButtonStyle2.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <!--这个文件的生成方式只能选 Page， 不用选resource 不然会提示
    无法从 iconPacks:PackIconMaterial 生成 TargetType -->
    
    
    <!--标准图标按钮 内部为iconPacks的按键，下方可带文字 -->
    <Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Base" >
        <Setter Property="Width" Value="36"/>
        <Setter Property="Height" Value="auto"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
    </Style>
    <Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Small" >
        <Setter Property="Width" Value="25"/>
        <Setter Property="Height" Value="auto"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
    </Style>
    <Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Large" >
        <Setter Property="Width" Value="50"/>
        <Setter Property="Height" Value="auto"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
    </Style>
    <Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Rectangle" >
        <Setter Property="Width" Value="20"/>
        <Setter Property="Height" Value="auto"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
    </Style>
    <Style TargetType="Button" x:Key="Styles.Button.Icon" BasedOn="{StaticResource Styles.Button.Empty}">
        <Style.Resources>
            <Style TargetType="TextBlock" >
                <Setter Property="FontSize" Value="12"/>
                <Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.Text}"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="FontFamily" Value="Microsoft Sans Serif"/>
                <Setter Property="Margin" Value="3"/>
            </Style>
            <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Base}"/>
        </Style.Resources>
        <Style.Setters>
            <Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
            <Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
        </Style.Setters>
    </Style>
    <!--小型图标按钮 内部为iconPacks的按键，下方不带文字 -->
    <Style TargetType="Button" x:Key="Styles.Button.Icon.Small" BasedOn="{StaticResource Styles.Button.Empty}">
        <Style.Resources>
            <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Small}"/>
        </Style.Resources>
        <Style.Setters>
            <Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
            <Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
        </Style.Setters>
    </Style>
    <!--大型图标按钮 内部为iconPacks的按键，下方可带文字 -->
    <Style TargetType="Button" x:Key="Styles.Button.Icon.Large" BasedOn="{StaticResource Styles.Button.Empty}">
        <Style.Resources>
            <Style TargetType="TextBlock" >
                <Setter Property="FontSize" Value="18"/>
                <Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.Text}"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
            </Style>
            <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Large}"/>
        </Style.Resources>
        <Style.Setters>
            <Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
            <Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
        </Style.Setters>
    </Style>


    <!--圆形确定按钮，绿色， 很多界面使用，例如扫描图 设置界面 -->
    <Style TargetType="Button" x:Key="Styles.Button.Apply" BasedOn="{StaticResource Styles.Button.Empty}">
        <Setter Property="Foreground" Value="#FF31AE15"/>
        <Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Content">
            <Setter.Value>
                <Grid>
                    <Ellipse Fill="White" Height="90" Width="90"/>
                    <iconPacks:PackIconMaterial Kind="CheckCircle" HorizontalAlignment="Center" VerticalAlignment="Center" Width="80" Height="auto" />
                </Grid>
            </Setter.Value>
        </Setter>
    </Style>

    <!--矩形图标按钮 内部为iconPacks的按键，下方不可带文字 -->
    <Style TargetType="Button" x:Key="Styles.Button.Icon.Rectangle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Style="{StaticResource Styles.Shadow}">
                        <Border 
                                        BorderBrush="{TemplateBinding BorderBrush}" 
                                        BorderThickness="{TemplateBinding BorderThickness}" 
                                        Background="{TemplateBinding Background}" 
                                        Height="40" 
                                        Width="40"
                                        >
                            <ContentPresenter RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" Value="{StaticResource Brushes.NoAct}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Opacity" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="{StaticResource Brushes.Activity}"/>
        <Setter Property="Foreground" Value="{StaticResource Brushes.ThemeBackground}"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
        <Style.Resources>
            <Style TargetType="iconPacks:PackIconMaterial"  BasedOn="{StaticResource Styles.Icon.Rectangle}"/>
        </Style.Resources>
    </Style>


    <!--使用iconPacks 的 checkbox -->
    <Style TargetType="{x:Type ToggleButton}" x:Key="Styles.ToggleButton.Check" >
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Background="{TemplateBinding Background}" CornerRadius="2" >
                        <iconPacks:PackIconMaterial x:Name="icon" Kind="CheckboxBlankOutline" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="icon" Property="Kind" Value="CheckboxMarkedOutline"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>