<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Ink_Canvas.Windows.Controls"
    xmlns:system="clr-namespace:System;assembly=netstandard">
    
    <Style TargetType="{x:Type local:WinUI3CloseButton}">
        <Setter Property="Width" Value="50" />
        <Setter Property="Height" Value="36" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource NewTimerWindowButtonForeground}" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:WinUI3CloseButton}">
                    <Border
                        x:Name="ButtonBorder"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="0,8,0,0">
                        <ContentPresenter
                            x:Name="PART_ContentPresenter"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsActive" Value="False">
                            <Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="0.382" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="Transparent" />
                            <Setter Property="Foreground" Value="#808080" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="ButtonBorder" Property="Background" Value="#E81123" />
                            <Setter Property="Foreground" Value="White" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="ButtonBorder" Property="Background" Value="#F1707A" />
                            <Setter Property="Foreground" Value="White" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 关闭按钮图标模板 -->
    <DataTemplate x:Key="CloseButtonIconTemplate" DataType="system:String">
        <TextBlock
            FontSize="15"
            FontWeight="SemiBold"
            Text="✕"
            HorizontalAlignment="Center"
            VerticalAlignment="Center" />
    </DataTemplate>

</ResourceDictionary>
