<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controlsHelper="clr-namespace:Platform.Controls.ControlsHelper"
                    xmlns:dhcc="http://www.dhcc.com.cn"
                    xmlns:tradeControl="clr-namespace:Platform.Controls.TradeExtension">
    <Style TargetType="{x:Type tradeControl:PageMessageBoxMetro}">
        <Setter Property="SizeToContent" Value="WidthAndHeight" />
        <Setter Property="WindowStyle" Value="None" />
        <Setter Property="ResizeMode" Value="NoResize" />
        <Setter Property="Background" Value="Wheat" />
        <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
        <Setter Property="FontSize" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type tradeControl:PageMessageBoxMetro}">
                    <dhcc:PageContainer>

                        <dhcc:TradePage x:Name="rootTradePage" dhcc:FocusManager.EnableFocusControl="{TemplateBinding IsEnableFocusControl}">
                            <dhcc:TradePage.Effect>
                                <DropShadowEffect BlurRadius="20"
                                                  RenderingBias="Quality"
                                                  Color="DarkGray" />
                            </dhcc:TradePage.Effect>
                            <Border x:Name="PART_Border"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="Black"
                                    BorderThickness="0">
                                <Grid x:Name="LayoutRoot"
                                      Width="{TemplateBinding Width}"
                                      Background="WhiteSmoke">
                                    <Border x:Name="border" HorizontalAlignment="Center">
                                        <Grid x:Name="rootGrid" MinHeight="150">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="1.2*" />
                                                <RowDefinition Height="0.3*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="0.3*" />
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>
                                            <Image Grid.RowSpan="4"
                                                   Grid.Column="0"
                                                   Width="80"
                                                   Height="80"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Source="{Binding RelativeSource={RelativeSource AncestorLevel=1,
                                                                                                   AncestorType={x:Type tradeControl:PageMessageBoxMetro},
                                                                                                   Mode=FindAncestor},
                                                                    Path=StateIcon}" />
                                            <!--  消息标题  -->
                                            <TextBlock x:Name="TxtTitle"
                                                       Grid.Row="0"
                                                       Grid.Column="1"
                                                       Margin="0,10"
                                                       HorizontalAlignment="Left"
                                                       FontSize="24"
                                                       FontWeight="Bold"
                                                       TextWrapping="NoWrap" />
                                            <Path Grid.Row="1"
                                                  Grid.Column="1"
                                                  Height="1"
                                                  Margin="0,0,0,5"
                                                  VerticalAlignment="Top"
                                                  Data="M0,64 L608,64"
                                                  Stretch="Fill">
                                                <Path.Stroke>
                                                    <LinearGradientBrush MappingMode="RelativeToBoundingBox" SpreadMethod="Repeat" StartPoint="0,0.5" EndPoint="1,0.5">
                                                        <GradientStop Offset="0" Color="White" />
                                                        <GradientStop Offset="0.1" Color="Green" />
                                                        <GradientStop Offset="0.9" Color="LightBlue" />
                                                        <GradientStop Offset="1" Color="White" />
                                                    </LinearGradientBrush>
                                                </Path.Stroke>
                                            </Path>
                                            <!--  消息内容  -->
                                            <ContentPresenter x:Name="TxtMessage"
                                                              Grid.Row="2"
                                                              Grid.Column="1"
                                                              Margin="0 ,5" />
                                            <StackPanel x:Name="ButtonGroup"
                                                        Grid.Row="3"
                                                        Grid.Column="1"
                                                        Margin="0,0,10,15"
                                                        HorizontalAlignment="Right"
                                                        Orientation="Horizontal">
                                                <StackPanel.Effect>
                                                    <DropShadowEffect BlurRadius="0.2"
                                                                      RenderingBias="Quality"
                                                                      Color="DarkGray" />
                                                </StackPanel.Effect>
                                                <StackPanel.Resources>
                                                    <Style BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type Button}">
                                                        <Setter Property="dhcc:FocusManager.FocusHandled" Value="{x:Static controlsHelper:ButtonHelper.ButtonFocusHandled}" />
                                                        <Setter Property="dhcc:FocusManager.IsInternalKeyboardControlling" Value="True" />
                                                        <Setter Property="dhcc:FocusManagerExt.IsFocusAdorner" Value="True" />
                                                        <Setter Property="MinHeight" Value="23" />
                                                        <Setter Property="MinWidth" Value="80" />
                                                        <Setter Property="Foreground" Value="#FFFFFFFF" />
                                                        <Setter Property="FontSize" Value="14" />
                                                        <Setter Property="BorderThickness" Value="0.5" />
                                                        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type Button}">
                                                                    <Grid>
                                                                        <VisualStateManager.VisualStateGroups>
                                                                            <VisualStateGroup x:Name="CommonStates">
                                                                                <VisualState x:Name="Normal" />
                                                                                <VisualState x:Name="MouseOver">
                                                                                    <Storyboard>
                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                        <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderThickness)">
                                                                                            <EasingThicknessKeyFrame KeyTime="0" Value="2" />
                                                                                        </ThicknessAnimationUsingKeyFrames>
                                                                                    </Storyboard>
                                                                                </VisualState>
                                                                                <VisualState x:Name="Pressed">
                                                                                    <Storyboard>
                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                        <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderThickness)">
                                                                                            <EasingThicknessKeyFrame KeyTime="0" Value="0" />
                                                                                        </ThicknessAnimationUsingKeyFrames>
                                                                                        <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(Border.BorderThickness)">
                                                                                            <EasingThicknessKeyFrame KeyTime="0" Value="2" />
                                                                                        </ThicknessAnimationUsingKeyFrames>
                                                                                    </Storyboard>
                                                                                </VisualState>
                                                                                <VisualState x:Name="Disabled">
                                                                                    <Storyboard>
                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                                                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.7" />
                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                                            <EasingDoubleKeyFrame KeyTime="0" Value="0.3" />
                                                                                        </DoubleAnimationUsingKeyFrames>
                                                                                    </Storyboard>
                                                                                </VisualState>
                                                                            </VisualStateGroup>
                                                                            <VisualStateGroup x:Name="FocusStates">
                                                                                <VisualState x:Name="Focused" />
                                                                                <VisualState x:Name="Unfocused" />
                                                                            </VisualStateGroup>
                                                                            <VisualStateGroup x:Name="ValidationStates">
                                                                                <VisualState x:Name="Valid" />
                                                                                <VisualState x:Name="InvalidFocused" />
                                                                                <VisualState x:Name="InvalidUnfocused" />
                                                                            </VisualStateGroup>
                                                                        </VisualStateManager.VisualStateGroups>
                                                                        <Border x:Name="Background"
                                                                                Background="#FF018BD7"
                                                                                BorderBrush="Black"
                                                                                BorderThickness="0.5" />
                                                                        <Rectangle x:Name="DisabledVisualElement"
                                                                                   Fill="Gray"
                                                                                   IsHitTestVisible="false"
                                                                                   Opacity="0" />
                                                                        <Border x:Name="MouseOverBorder"
                                                                                Background="DarkGray"
                                                                                Opacity="0" />
                                                                        <Border x:Name="PressedBorder"
                                                                                Background="DarkGray"
                                                                                BorderBrush="DarkGray"
                                                                                Opacity="0" />
                                                                        <ContentPresenter x:Name="contentPresenter"
                                                                                          Margin="{TemplateBinding Padding}"
                                                                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                                                          Content="{TemplateBinding Content}"
                                                                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                                          OpacityMask="{x:Null}" />
                                                                    </Grid>

                                                                    <ControlTemplate.Triggers>
                                                                        <Trigger Property="IsPressed" Value="true">
                                                                            <Setter Property="Foreground" Value="White" />
                                                                        </Trigger>
                                                                    </ControlTemplate.Triggers>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </StackPanel.Resources>
                                            </StackPanel>
                                        </Grid>
                                    </Border>
                                </Grid>
                            </Border>
                        </dhcc:TradePage>
                    </dhcc:PageContainer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
