<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">
    <dhcc:BoolToVisibilityConverter x:Key="BoolToVisibility" />

    <Style TargetType="Presentation:PageContainer">
        <!--  PageContainer不设置FocusManager.EnableFocusControl附加属性，延迟由TradePage来指定  -->
        <!--  <Setter Property="dhcc:FocusManager.EnableFocusControl" Value="true"/>  -->
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Presentation:PageContainer">
                    <Border>
                        <Grid>
                            <AdornerDecorator>
                                <ContentPresenter Margin="{TemplateBinding BorderThickness}"
                                              HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                              Content="{TemplateBinding Content}" />
                            </AdornerDecorator>
                            <Grid x:Name="Overlay"
                                  Margin="0"
                                  Background="#7F000000"
                                  Opacity="1"
                                  Visibility="{TemplateBinding IsOverlay, Converter={StaticResource BoolToVisibility}}" />
                            <Border x:Name="BusyAdorner"
                                    Tag="正在处理数据..."
                                    Visibility="Collapsed">
                                <Grid>
                                    <Border Background="Black" Opacity="0.1" />
                                    <!--  缓冲动画  -->
                                    <Border HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Background="White"
                                            BorderBrush="Blue"
                                            BorderThickness="2"
                                            TextBlock.FontSize="20">
                                        <StackPanel Margin="5" Orientation="Horizontal">
                                            <Presentation:SprocketControl x:Name="sprocketControl"
                                                                          Width="30"
                                                                          Height="30"
                                                                          HorizontalAlignment="Center"
                                                                          VerticalAlignment="Top"
                                                                          AlphaTicksPercentage="50"
                                                                          Interval="100"
                                                                          IsIndeterminate="False"
                                                                          LowestAlpha="50"
                                                                          StartAngle="-90"
                                                                          TickColor="Blue"
                                                                          TickCount="10"
                                                                          TickWidth="3" />
                                            <TextBlock VerticalAlignment="Center" Text="{Binding ElementName=BusyAdorner, Path=Tag}" />
                                        </StackPanel>
                                    </Border>
                                </Grid>
                            </Border>
                        </Grid>
                    </Border>
                    <!--  不通过触发器触发缓冲动画  -->
                    <!--
                        <ControlTemplate.Triggers>
                        <Trigger Property="IsBusy" Value="True">
                        <Setter TargetName="cover" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsBusy" Value="False">
                        <Setter TargetName="cover" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        </ControlTemplate.Triggers>
                    -->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>