<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:dhcc="http://www.dhcc.com.cn"
                    xmlns:presentation="clr-namespace:Platform.Presentation.PageFunctions;assembly=Platform.Presentation"
                    xmlns:tradeControl="clr-namespace:Platform.Controls.TradeExtension">
    <Style TargetType="{x:Type ResizeGrip}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ResizeGrip}">
                    <Border Width="16"
                            Height="16"
                            Background="Transparent"
                            SnapsToDevicePixels="True">
                        <Rectangle Margin="2">
                            <Rectangle.Fill>
                                <DrawingBrush TileMode="Tile"
                                              Viewbox="0,0,8,8"
                                              ViewboxUnits="Absolute"
                                              Viewport="0,0,4,4"
                                              ViewportUnits="Absolute">
                                    <DrawingBrush.Drawing>
                                        <DrawingGroup>
                                            <DrawingGroup.Children>
                                                <GeometryDrawing Brush="#FFAAAAAA" Geometry="M 4 4 L 4 8 L 8 8 L 8 4 z" />
                                            </DrawingGroup.Children>
                                        </DrawingGroup>
                                    </DrawingBrush.Drawing>
                                </DrawingBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFFBFBEB" />
    <SolidColorBrush x:Key="InfoBackBrush" Color="#FFDFDFDF" />

    <Style TargetType="{x:Type tradeControl:PageMessageBox}">
        <!--  <Setter Property="Presentation:FocusManager.EnableFocusControl" Value="True"/>  -->
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="Icon" Value="/Platform.Controls;component/Resource/MainICO.png" />
        <Setter Property="ResizeMode" Value="NoResize" />
        <Setter Property="SizeToContent" Value="WidthAndHeight" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type tradeControl:PageMessageBox}">
                    <presentation:PageContainer>
                        <presentation:TradePage x:Name="rootTradePage" dhcc:FocusManager.EnableFocusControl="{TemplateBinding IsEnableFocusControl}">
                            <Border Background="{StaticResource InfoBackBrush}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}">
                                <Border Background="{StaticResource WindowBackgroundBrush}"
                                        BorderBrush="#FF807F7F"
                                        BorderThickness="1"
                                        CornerRadius="0,0,5,5">
                                    <Grid Margin="10,3">
                                        <AdornerDecorator>
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="Auto" />
                                                    <RowDefinition Height="*" />
                                                </Grid.RowDefinitions>
                                                <Grid Grid.Row="0">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto" />
                                                        <ColumnDefinition Width="*" />
                                                    </Grid.ColumnDefinitions>
                                                    <Image Name="image"
                                                           Grid.Column="0"
                                                           Width="22"
                                                           Height="22"
                                                           Margin="15,0,0,0" />
                                                    <ContentPresenter Grid.Column="1"
                                                                      Margin="10"
                                                                      Content="{Binding Path=Content,
                                                                                        RelativeSource={RelativeSource TemplatedParent}}" />
                                                </Grid>
                                                <StackPanel Name="buttonsStackPanel"
                                                            Grid.Row="1"
                                                            HorizontalAlignment="Center"
                                                            Orientation="Horizontal">
                                                    <Button Name="Yes"
                                                            Width="85"
                                                            Height="25"
                                                            Margin="8"
                                                            HorizontalAlignment="Center"
                                                            VerticalAlignment="Center"
                                                            Command="{x:Static tradeControl:PageMessageBox.CloseCommand}"
                                                            CommandParameter="Yes"
                                                            Content="是" />
                                                    <Button Name="OK"
                                                            Width="85"
                                                            Height="25"
                                                            Margin="8"
                                                            HorizontalAlignment="Center"
                                                            VerticalAlignment="Center"
                                                            Command="{x:Static tradeControl:PageMessageBox.CloseCommand}"
                                                            CommandParameter="OK"
                                                            Content="确定" />
                                                    <Button Name="No"
                                                            Width="85"
                                                            Height="25"
                                                            Margin="8"
                                                            HorizontalAlignment="Center"
                                                            VerticalAlignment="Center"
                                                            Command="{x:Static tradeControl:PageMessageBox.CloseCommand}"
                                                            CommandParameter="No"
                                                            Content="否" />
                                                    <Button Name="Cancel"
                                                            Width="85"
                                                            Height="25"
                                                            Margin="8"
                                                            HorizontalAlignment="Center"
                                                            VerticalAlignment="Center"
                                                            Command="{x:Static tradeControl:PageMessageBox.CloseCommand}"
                                                            CommandParameter="Cancel"
                                                            Content="取消" />
                                                </StackPanel>
                                            </Grid>
                                        </AdornerDecorator>
                                        <ResizeGrip x:Name="WindowResizeGrip"
                                                    HorizontalAlignment="Right"
                                                    VerticalAlignment="Bottom"
                                                    IsTabStop="false"
                                                    Visibility="Collapsed" />
                                    </Grid>
                                </Border>
                            </Border>
                        </presentation:TradePage>
                    </presentation:PageContainer>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
                            <Setter TargetName="WindowResizeGrip" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxButton" Value="OK">
                            <Setter TargetName="OK" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Yes" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="No" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Cancel" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="OK" Property="IsDefault" Value="true" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxButton" Value="OKCancel">
                            <Setter TargetName="OK" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Yes" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="No" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Cancel" Property="Visibility" Value="Visible" />
                            <Setter TargetName="OK" Property="IsDefault" Value="true" />
                            <Setter TargetName="Cancel" Property="IsCancel" Value="true" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxButton" Value="YesNoCancel">
                            <Setter TargetName="OK" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Yes" Property="Visibility" Value="Visible" />
                            <Setter TargetName="No" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Cancel" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Yes" Property="IsDefault" Value="true" />
                            <Setter TargetName="Cancel" Property="IsCancel" Value="true" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxButton" Value="YesNo">
                            <Setter TargetName="OK" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Yes" Property="Visibility" Value="Visible" />
                            <Setter TargetName="No" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Cancel" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Yes" Property="IsDefault" Value="true" />
                            <Setter TargetName="No" Property="IsCancel" Value="true" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxImage" Value="Error">
                            <Setter TargetName="image" Property="Visibility" Value="Visible" />
                            <Setter TargetName="image" Property="Source" Value="/Platform.Controls;component/Resource/PageMessageBox_error.png" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxImage" Value="Information">
                            <Setter TargetName="image" Property="Visibility" Value="Visible" />
                            <Setter TargetName="image" Property="Source" Value="/Platform.Controls;component/Resource/PageMessageBox_information.png" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxImage" Value="None">
                            <Setter TargetName="image" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxImage" Value="Question">
                            <Setter TargetName="image" Property="Visibility" Value="Visible" />
                            <Setter TargetName="image" Property="Source" Value="/Platform.Controls;component/Resource/PageMessageBox_question.png" />
                        </Trigger>
                        <Trigger Property="PageMessageBoxImage" Value="Warning">
                            <Setter TargetName="image" Property="Visibility" Value="Visible" />
                            <Setter TargetName="image" Property="Source" Value="/Platform.Controls;component/Resource/PageMessageBox_warning.png" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>