<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:hc="clr-namespace:HandyControl.Controls"
                    xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
                    xmlns:langs="clr-namespace:HandyControl.Properties.Langs"
                    xmlns:ex="clr-namespace:HandyControl.Tools.Extension"
                    xmlns:themes="clr-namespace:HandyControl.Themes">

    <ResourceDictionary.MergedDictionaries>
        <themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/Button.xaml"/>
        <themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Basic/Converters.xaml"/>
        <themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Basic/Paths.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="hc:PopupWindow">
        <Setter Property="WindowStyle" Value="None"/>
        <Setter Property="MinHeight" Value="220"/>
        <Setter Property="UseLayoutRounding" Value="True"/>
        <Setter Property="BorderThickness" Value="20"/>
        <Setter Property="ShowInTaskbar" Value="False"/>
        <Setter Property="MinWidth" Value="300"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
        <Setter Property="SizeToContent" Value="WidthAndHeight"/>
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect Opacity=".6" ShadowDepth="0" BlurRadius="15"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="hc:PopupWindow">
                    <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid Name="TitleGrid" Height="30" Background="{DynamicResource TitleBrush}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Name="PART_TitleBlock" Background="Transparent" Padding="{StaticResource DefaultControlPadding}" Foreground="White" Text="{TemplateBinding Title}" VerticalAlignment="Center" TextWrapping="Wrap" TextTrimming="WordEllipsis"/>
                                <Button Margin="0,0,1,0" Background="Transparent" Name="CloseButton" Foreground="White" Grid.Column="1" hc:BackgroundSwitchElement.MouseHoverBackground="Red" hc:BackgroundSwitchElement.MouseDownBackground="Red" Command="interactivity:ControlCommands.Close" IsCancel="True" Height="28" Style="{StaticResource ButtonCustom}" Width="44" Padding="9">
                                    <Path Fill="{Binding ElementName=CloseButton,Path=Foreground}" Style="{StaticResource ClosePathStyle}"/>
                                </Button>
                            </Grid>
                            <Border BorderBrush="{DynamicResource TitleBrush}" Name="PART_MainBorder" Grid.Row="1">
                                <StackPanel>
                                    <TextBlock Text="{TemplateBinding ContentStr}" MinHeight="110" Name="MyTextBlock" TextAlignment="Center" Padding="32" Foreground="{DynamicResource PrimaryTextBrush}" MaxWidth="300" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Background="{TemplateBinding Background}"/>
                                    <StackPanel Margin="0,0,0,32" Orientation="Horizontal" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Center">
                                        <Button IsCancel="True" MinWidth="80" Command="interactivity:ControlCommands.Cancel" Content="{ex:Lang Key={x:Static langs:LangKeys.Cancel}}" Visibility="{TemplateBinding ShowCancel,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="0,0,16,0"/>
                                        <Button IsDefault="True" MinWidth="80" Command="interactivity:ControlCommands.Confirm" Content="{ex:Lang Key={x:Static langs:LangKeys.Confirm}}" Style="{StaticResource ButtonPrimary}"/>
                                    </StackPanel>
                                </StackPanel>
                            </Border>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ShowBorder" Value="True">
                            <Setter Property="BorderThickness" Value="1,0,1,1" TargetName="PART_MainBorder"/>
                        </Trigger>
                        <Trigger Property="ShowTitle" Value="False">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="TitleGrid"/>
                            <Setter Property="Background" Value="Transparent"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>