<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:control="clr-namespace:SmartUI.Controls">
    <Style x:Key="DialogWindowStyle" TargetType="{x:Type control:ChildWindow}">
        <Setter Property="ShowInTaskbar" Value="False"/>
        <Setter Property="AllowsTransparency" Value="True"/>
        <Setter Property="WindowStyle" Value="None"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="MinHeight" Value="150"/>
        <Setter Property="MinWidth" Value="300"/>
        <Setter Property="Width" Value="500"/>
        <Setter Property="Height" Value="240"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="#FAFAFA"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate  TargetType="{x:Type control:ChildWindow}">
                    <Grid Name="PART_WindowRoot" Background="Transparent">
                        <Border Margin="20" Background="{TemplateBinding Background}" BorderThickness="0" BorderBrush="LightGray" CornerRadius="4">
                            <Border.Effect>
                                <DropShadowEffect BlurRadius="15" Direction="270" ShadowDepth="6" Color="LightGray" />
                            </Border.Effect>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="44" />
                                    <RowDefinition Height="6" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Border Grid.Row="0" Background="White" CornerRadius="4 4 0 0">
                                    <DockPanel LastChildFill="True" Background="White">
                                       <Button x:Name="closeBtn" DockPanel.Dock="Right" Style="{DynamicResource SystemCloseButtonStyle}" Width="60" Height="44"/>
                                        <Border Name="borderTitle" Background="Transparent">
                                            <TextBlock Foreground="#FF5A5A5A" IsHitTestVisible="False" Margin="20,0,0,0" VerticalAlignment="Center" FontSize="18" FontWeight="Bold" Text="{TemplateBinding Title}"/>
                                        </Border>
                                    </DockPanel>
                                </Border>
                                <Rectangle Height="8" Grid.Row="1">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                            <GradientStop Color="#CCCCCC" Offset="0.0" />
                                            <GradientStop Color="#DDDDDD" Offset="0.1" />
                                            <GradientStop Color="#FAFAFA" Offset="0.4" />
                                            <GradientStop Color="White" Offset="1.0" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <!--  内容  -->
                                <Border Grid.Row="2" Padding="10 0" Background="White">
                                    <AdornerDecorator>
                                        <ContentPresenter  x:Name="PART_WindowControl"/>
                                    </AdornerDecorator>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SystemCloseButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="50"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border x:Name="border" Background="Transparent" Cursor="Hand">
                        <control:PackIcon x:Name="icon" Kind="Close" Width="24" Height="24" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{DynamicResource TextEnabledColor}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="Background" Value="Red"/>
                            <Setter TargetName="icon" Property="Foreground" Value="White"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DialogButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="MinWidth" Value="60"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="Foreground" Value="#333333"/>
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="Margin" Value="5 0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border CornerRadius="4" BorderThickness="1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" BorderBrush="{DynamicResource PrimaryBorderGaryColor}" Background="{TemplateBinding Background}">
                        <Label Content="{TemplateBinding Content}" VerticalAlignment="Center" VerticalContentAlignment="Center"
                           HorizontalContentAlignment="Center" Foreground="{TemplateBinding Foreground}" Cursor="Hand"/>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value="0.8"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>