<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:con="clr-namespace:HBLConsole.Converter"
    xmlns:pry="clr-namespace:HBLConsole.PryUserControl;assembly=HBLConsole.PryUserControl">

    <!--#region 全局样式-->
    <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
    <!--#endregion-->

    <!--#region 转换器-->
    <con:ColorConverter x:Key="ColorConverter" />
    <!--<con:ColorConverter x:Key="ColorConverter" />-->
    <con:TextConverter x:Key="TextConverter" />
    <con:VisibleConvert x:Key="VisibleConvert" />
    <!--#endregion-->

    <!--#region 右斜边按钮-->
    <Style x:Key="BeveledRadioButtonStyle" TargetType="{x:Type RadioButton}">
        <Setter Property="FontFamily" Value="楷体" />
        <Setter Property="Width" Value="100" />
        <Setter Property="Height" Value="30" />
        <Setter Property="IsChecked" Value="False" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Foreground" Value="#ddd" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Grid x:Name="gr" SnapsToDevicePixels="True">

                        <pry:BeveledButton
                            x:Name="bb"
                            FillColor="#4B8EC4"
                            IsParallelogram="False"
                            StrokeThickness="1" />

                        <ContentPresenter
                            x:Name="contentPresenter"
                            Margin="0,0,10,0"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Content="{TemplateBinding Content}"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Focusable="False"
                            RecognizesAccessKey="True"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter TargetName="bb" Property="FillColor" Value="#55007acc" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--#endregion-->

    <!--#region 平行四边形按钮-->
    <Style x:Key="ParallelogramRadioButtonStyle" TargetType="{x:Type RadioButton}">
        <Setter Property="FontFamily" Value="楷体" />
        <Setter Property="Width" Value="100" />
        <Setter Property="IsChecked" Value="False" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Foreground" Value="#ddd" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Grid SnapsToDevicePixels="True">

                        <pry:BeveledButton
                            x:Name="bb"
                            FillColor="#4B8EC4"
                            IsParallelogram="True"
                            StrokeThickness="1" />

                        <ContentPresenter
                            x:Name="contentPresenter"
                            Margin="0,0,10,0"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Content="{TemplateBinding Content}"
                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            Focusable="False"
                            RecognizesAccessKey="True"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter TargetName="bb" Property="FillColor" Value="#55007acc" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--#endregion-->

    <!--#region 标题栏按钮样式-->
    <Style x:Key="TitleBarStyle" TargetType="Button">
        <Setter Property="Foreground" Value="#5500c2f4" />
        <Setter Property="FontSize" Value="24" />
        <Setter Property="FontFamily" Value="../../Resources/Fonts/#iconfont" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Name="TitleBarBr" Background="Transparent">
                        <ContentPresenter
                            Margin="{TemplateBinding Margin}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="TitleBarBr" Property="Background" Value="#33ffffff" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--#endregion-->

    <!--#region CheckBox复选框样式-->
    <ControlTemplate x:Key="CbTemplate" TargetType="{x:Type CheckBox}">
        <Grid Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Viewbox
                Width="{TemplateBinding Height}"
                Height="{TemplateBinding Height}"
                HorizontalAlignment="Left">
                <Grid Width="20" Height="20">
                    <!--  需要设置选择框的圆角 RadiusX="4" RadiusY="4"  -->
                    <Rectangle Stroke="{TemplateBinding Background}" />
                    <!--  M:表示起始点 点1的位置 L:直线 点2的位置 点3的位置 点4的位置 点5的位置 Z:结束  -->
                    <Path
                        x:Name="path"
                        Data="M 2,9 L 9,17 17,3 8,12 Z"
                        Fill="{TemplateBinding Background}"
                        RenderTransformOrigin="0.5,0.5"
                        StrokeThickness="2">
                        <Path.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="0" ScaleY="0" />
                                <SkewTransform />
                                <RotateTransform />
                                <TranslateTransform />
                            </TransformGroup>
                        </Path.RenderTransform>
                    </Path>
                </Grid>
            </Viewbox>
            <ContentPresenter
                Name="cb"
                Grid.Column="1"
                Margin="5,0,0,0"
                HorizontalAlignment="Left"
                VerticalAlignment="Center" />
        </Grid>

        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>

                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
            </Trigger>

            <!--<Trigger Property="IsMouseOver" Value="true">
                <Setter TargetName="cb" Property="HorizontalAlignment" Value="Center" />
            </Trigger>-->

        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!--#endregion-->

    <!--#region ScrollViewer 样式-->
    <Style x:Key="ScrollViewerStyle" TargetType="{x:Type ScrollViewer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <!--  View区域背景色  -->
                    <Grid x:Name="Grid" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Rectangle
                            x:Name="Corner"
                            Grid.Row="1"
                            Grid.Column="1"
                            Fill="Transparent" />
                        <ScrollContentPresenter
                            x:Name="PART_ScrollContentPresenter"
                            Grid.Row="0"
                            Grid.Column="0"
                            Margin="{TemplateBinding Padding}"
                            CanContentScroll="{TemplateBinding CanContentScroll}"
                            CanHorizontallyScroll="False"
                            CanVerticallyScroll="False"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}" />
                        <ScrollBar
                            x:Name="PART_VerticalScrollBar"
                            Grid.Row="0"
                            Grid.Column="1"
                            AutomationProperties.AutomationId="VerticalScrollBar"
                            Cursor="Arrow"
                            Maximum="{TemplateBinding ScrollableHeight}"
                            Minimum="0"
                            Opacity="0"
                            Style="{DynamicResource MyScrollBarStyle}"
                            ViewportSize="{TemplateBinding ViewportHeight}"
                            Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                            Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
                        <ScrollBar
                            x:Name="PART_HorizontalScrollBar"
                            Grid.Row="1"
                            Grid.Column="0"
                            AutomationProperties.AutomationId="HorizontalScrollBar"
                            Cursor="Arrow"
                            Maximum="{TemplateBinding ScrollableWidth}"
                            Minimum="0"
                            Opacity="0"
                            Orientation="Horizontal"
                            Style="{DynamicResource MyScrollBarStyle}"
                            ViewportSize="{TemplateBinding ViewportWidth}"
                            Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                            Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
                    </Grid>

                    <!--  使用多条件触发器  -->
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="ScrollChanged">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="1"
                                        Duration="0:0:1" />
                                    <DoubleAnimation
                                        BeginTime="0:0:1"
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0"
                                        Duration="0:0:1" />
                                    <DoubleAnimation
                                        Storyboard.TargetName="PART_HorizontalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="1"
                                        Duration="0:0:1" />
                                    <DoubleAnimation
                                        BeginTime="0:0:1"
                                        Storyboard.TargetName="PART_HorizontalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0"
                                        Duration="0:0:1" />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>

                        <EventTrigger RoutedEvent="MouseEnter" SourceName="PART_VerticalScrollBar">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="1"
                                        Duration="0:0:1" />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>

                        <EventTrigger RoutedEvent="MouseLeave" SourceName="PART_VerticalScrollBar">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation
                                        Storyboard.TargetName="PART_VerticalScrollBar"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0"
                                        Duration="0:0:1" />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>

                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--  初始滚动条样式  -->
    <SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="Transparent" />

    <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Rectangle
                        Width="{TemplateBinding Width}"
                        Height="{TemplateBinding Height}"
                        Fill="{TemplateBinding Background}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--  滚动条颜色、圆角等设置  -->
    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <!--  滚动条颜色和圆角设置  -->
                    <Rectangle
                        Name="thumbRect"
                        Fill="#334B8EC4"
                        RadiusX="3"
                        RadiusY="3" />
                    <!--  鼠标拉动滚动条时的颜色  -->
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="thumbRect" Property="Fill" Value="CornflowerBlue" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Focusable" Value="false" />
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Rectangle
                        Width="{TemplateBinding Width}"
                        Height="{TemplateBinding Height}"
                        Fill="{TemplateBinding Background}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="MyScrollBarStyle" TargetType="{x:Type ScrollBar}">
        <Setter Property="Background" Value="AliceBlue" />
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="false" />
        <!--  滚动条宽度  -->
        <Setter Property="Width" Value="8" />
        <Setter Property="MinWidth" Value="6" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollBar}">
                    <!--  滚动条背景色  -->
                    <Grid
                        x:Name="Bg"
                        Width="8"
                        Background="#884B8EC4"
                        SnapsToDevicePixels="true">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Track
                            x:Name="PART_Track"
                            IsDirectionReversed="true"
                            IsEnabled="{TemplateBinding IsMouseOver}">
                            <Track.DecreaseRepeatButton>
                                <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
                            </Track.DecreaseRepeatButton>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
                            </Track.IncreaseRepeatButton>
                            <Track.Thumb>
                                <Thumb Style="{StaticResource ScrollBarThumb}" />
                            </Track.Thumb>
                        </Track>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Bg" Property="Background" Value="{StaticResource ScrollBarDisabledBackground}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto" />
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="Height" Value="6" />
                <Setter Property="MinHeight" Value="6" />
                <Setter Property="Background" Value="AliceBlue" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollBar}">
                            <Grid
                                x:Name="Bg"
                                Background="#334B8EC4"
                                SnapsToDevicePixels="true">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
                                    </Track.DecreaseRepeatButton>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
                                    </Track.IncreaseRepeatButton>
                                    <Track.Thumb>
                                        <Thumb Style="{StaticResource ScrollBarThumb}" />
                                    </Track.Thumb>
                                </Track>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter TargetName="Bg" Property="Background" Value="{StaticResource ScrollBarDisabledBackground}" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
    <!--#endregion-->

    <!--#region TextBox 样式-->
    <Style x:Key="InputTextboxStyle" TargetType="TextBox">
        <Setter Property="Margin" Value="3,0,0,0" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>
    <!--#endregion-->

    <!--#region 新建按钮-->
    <ControlTemplate x:Key="NewButtonTemp" TargetType="Button">
        <Border
            x:Name="br"
            Background="Transparent"
            BorderBrush="#FF19B7EC"
            BorderThickness="2">
            <StackPanel
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <TextBlock
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontFamily="../Fonts/#iconfont"
                    Text="&#xe626;" />
                <ContentControl
                    Margin="10,0,5,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{TemplateBinding Content}"
                    Foreground="{TemplateBinding Foreground}" />
            </StackPanel>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!--#endregion-->

    <!--#region 保存按钮-->
    <ControlTemplate x:Key="SaveButtonTemp" TargetType="Button">
        <Border
            x:Name="br"
            Background="Transparent"
            BorderBrush="#FF19B7EC"
            BorderThickness="2">
            <StackPanel
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <TextBlock
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontFamily="../Fonts/#iconfont"
                    FontSize="20"
                    Text="&#xe936;" />
                <ContentControl
                    Margin="10,0,5,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{TemplateBinding Content}"
                    Foreground="{TemplateBinding Foreground}" />
            </StackPanel>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!--#endregion-->

    <!--#region 取消按钮-->
    <ControlTemplate x:Key="CancelButtonTemp" TargetType="Button">
        <Border
            x:Name="br"
            Background="Transparent"
            BorderBrush="#FF19B7EC"
            BorderThickness="2">
            <StackPanel
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <TextBlock
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontFamily="../Fonts/#iconfont"
                    FontSize="20"
                    Text="&#xe8e7;" />
                <ContentControl
                    Margin="10,0,5,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{TemplateBinding Content}"
                    Foreground="{TemplateBinding Foreground}" />
            </StackPanel>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!--#endregion-->

    <!--#region 确认按钮-->
    <ControlTemplate x:Key="ConfirmButtonTemp" TargetType="Button">
        <Border
            x:Name="br"
            Background="Transparent"
            BorderBrush="#FF19B7EC"
            BorderThickness="2">
            <StackPanel
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <TextBlock
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontFamily="../Fonts/#iconfont"
                    FontSize="20"
                    Text="&#xe62a;" />
                <ContentControl
                    Margin="10,0,5,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{TemplateBinding Content}"
                    Foreground="{TemplateBinding Foreground}" />
            </StackPanel>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!--#endregion-->

    <!--#region 移除按钮样式-->
    <ControlTemplate x:Key="ButtonTemplate" TargetType="Button">
        <Border
            x:Name="br"
            Background="Transparent"
            BorderBrush="#FFDE7889"
            BorderThickness="2"
            CornerRadius="0">
            <StackPanel
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <TextBlock
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    FontFamily="../Fonts/#iconfont"
                    FontSize="20"
                    Text="&#xe68e;" />
                <ContentControl
                    Margin="10,0,5,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{TemplateBinding Content}"
                    Foreground="{TemplateBinding Foreground}" />
            </StackPanel>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="br" Property="Background" Value="#22DE7889" />
            </Trigger>

            <Trigger Property="IsPressed" Value="true">
                <Setter TargetName="br" Property="Background" Value="#22DE7889" />
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>
    <!--#endregion-->

    <!--#region 编辑开关 ToggleButton 样式-->
    <Style x:Key="EditToggleButtonStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <Border
                            x:Name="border2"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Background="Transparent">
                            <ContentPresenter
                                Margin="{TemplateBinding Padding}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                RecognizesAccessKey="True"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <!--<Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" Value="#FFd2e7f4" />
                        </Trigger>-->

                        <!--  控件选中  -->
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Foreground" Value="#ff1002E9" />
                        </Trigger>

                        <!--  控件未选中  -->
                        <Trigger Property="IsChecked" Value="false">
                            <Setter Property="Foreground" Value="#ff2AB2E7" />
                        </Trigger>

                        <!--  鼠标进入  -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border2" Property="Background" Value="#332AB2E7" />
                        </Trigger>

                        <!--  控件禁用  -->
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#662AB2E7" />
                        </Trigger>

                        <!--  控件启用  -->
                        <Trigger Property="IsEnabled" Value="True">
                            <Setter Property="Foreground" Value="#ff2AB2E7" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--#endregion-->

    <!--#region ComboBox 样式-->
    <!--  ComBoBox项选中背景色  -->
    <SolidColorBrush x:Key="ComboBoxSelectdBackground" Color="#AA3ba7f2" />
    <!--  ComBoBox项鼠标经过背景色  -->
    <SolidColorBrush x:Key="ComboBoxMouseOverBackground" Color="#553ba7f2" />
    <!--  ComBoBox项选中前景色  -->
    <SolidColorBrush x:Key="ComboBoxSelectedForeground" Color="#DDD" />
    <!--  ComBoBox项鼠标经过前景色  -->
    <SolidColorBrush x:Key="ComboBoxMouseOverForegrond" Color="#DDD" />

    <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
        <Grid Height="25" HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="30" />
            </Grid.ColumnDefinitions>
            <Border
                Grid.ColumnSpan="2"
                Background="White"
                Opacity="0" />
            <TextBlock
                Grid.Column="1"
                Margin="0,0,5,0"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                FontFamily="../Fonts/#iconfont"
                FontSize="14"
                Foreground="#FF23CACA"
                Text="&#xe64d;" />
            <!--<Path
                x:Name="Arrow"
                Grid.Column="1"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Data="M 0 0  6 6 12 0 Z"
                Fill="#aa20FDFA"
                Stretch="None">
                <Path.Effect>
                    <DropShadowEffect
                        BlurRadius="10"
                        Direction="90"
                        Opacity="1"
                        RenderingBias="Quality"
                        ShadowDepth="0"
                        Color="#aa20FDFA" />
                </Path.Effect>
            </Path>-->
        </Grid>
        <!--<ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="Arrow" Property="RenderTransform">
                    <Setter.Value>
                        <RotateTransform Angle="180" CenterX="6" CenterY="3" />
                    </Setter.Value>
                </Setter>
                <Setter TargetName="Arrow" Property="Margin" Value="0,0,0,2" />
            </Trigger>
        </ControlTemplate.Triggers>-->
    </ControlTemplate>

    <Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}">
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="ComboBoxItem">
                    <Setter Property="Height" Value="25" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                                <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                                    <Border x:Name="_borderbg" Background="Transparent" />

                                    <TextBlock
                                        x:Name="_txt"
                                        Margin="3,0,3,0"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Foreground="#DDD"
                                        Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" />

                                    <Border
                                        x:Name="_border"
                                        Background="#103153"
                                        Opacity="0" />
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsSelected" Value="true">
                                        <Setter TargetName="_txt" Property="Foreground" Value="{StaticResource ComboBoxSelectedForeground}" />
                                        <Setter TargetName="_borderbg" Property="Background" Value="{StaticResource ComboBoxSelectdBackground}" />
                                    </Trigger>
                                    <MultiTrigger>
                                        <MultiTrigger.Conditions>
                                            <Condition Property="IsSelected" Value="false" />
                                            <Condition Property="IsMouseOver" Value="true" />
                                        </MultiTrigger.Conditions>
                                        <Setter TargetName="_borderbg" Property="Background" Value="{StaticResource ComboBoxMouseOverBackground}" />
                                        <Setter TargetName="_txt" Property="Foreground" Value="{StaticResource ComboBoxMouseOverForegrond}" />
                                    </MultiTrigger>

                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.7*" />
                            <ColumnDefinition Width="0.3*" MaxWidth="30" />
                        </Grid.ColumnDefinitions>
                        <Border
                            x:Name="_prybr"
                            Grid.Column="0"
                            Grid.ColumnSpan="2"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="0" />
                        <ContentPresenter
                            x:Name="ContentSite"
                            Margin="3,3,0,3"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Content="{TemplateBinding SelectionBoxItem}"
                            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                            IsHitTestVisible="False" />

                        <!--  ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen  -->
                        <ToggleButton
                            x:Name="ToggleButton"
                            Grid.Column="0"
                            Grid.ColumnSpan="2"
                            ClickMode="Press"
                            Focusable="false"
                            IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                            Template="{StaticResource ComboBoxToggleButton}" />
                        <!--  必须将 TextBox 命名为 PART_EditableTextBox，否则 ComboBox 将无法识别它  -->
                        <TextBox
                            x:Name="PART_EditableTextBox"
                            Margin="2,0,0,0"
                            VerticalAlignment="Center"
                            Background="Transparent"
                            BorderThickness="0"
                            Focusable="True"
                            IsReadOnly="{TemplateBinding IsReadOnly}"
                            Visibility="Hidden" />

                        <!--  Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen  -->
                        <Popup
                            x:Name="Popup"
                            AllowsTransparency="True"
                            Focusable="False"
                            IsOpen="{TemplateBinding IsDropDownOpen}"
                            Placement="Bottom"
                            PopupAnimation="Slide">
                            <Grid
                                x:Name="DropDown"
                                MinWidth="{TemplateBinding ActualWidth}"
                                MaxHeight="150"
                                SnapsToDevicePixels="True">
                                <Border
                                    x:Name="DropDownBorder"
                                    BorderBrush="#3ba7f2"
                                    BorderThickness="0" />
                                <ScrollViewer
                                    Margin="1"
                                    CanContentScroll="True"
                                    HorizontalScrollBarVisibility="Auto"
                                    SnapsToDevicePixels="True"
                                    VerticalScrollBarVisibility="Auto">
                                    <!--  StackPanel 用于显示子级，方法是将 IsItemsHost 设置为 True  -->
                                    <!--  一下可以设置列表背景色  -->
                                    <StackPanel
                                        Background="#103153"
                                        IsItemsHost="True"
                                        KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEditable" Value="true">
                            <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="_prybr" Property="BorderBrush" Value="#aa3ba7f2" />
                            <!--<Setter Property="Background" Value="#553ba7f2" TargetName="_prybr"/>-->
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--#endregion-->

    <!--#region GroupBox样式-->
    <BorderGapMaskConverter x:Key="BorderGapMaskConverter" />
    <Style x:Key="GroupBoxStyle1" TargetType="{x:Type GroupBox}">
        <Setter Property="BorderBrush" Value="#D5DFE5" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GroupBox}">
                    <Grid SnapsToDevicePixels="true">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="6" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="6" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="6" />
                        </Grid.RowDefinitions>
                        <Border
                            Grid.Row="1"
                            Grid.RowSpan="3"
                            Grid.Column="0"
                            Grid.ColumnSpan="4"
                            Background="{TemplateBinding Background}"
                            BorderBrush="Transparent"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="0" />
                        <Border
                            Name="Header"
                            Grid.Row="0"
                            Grid.RowSpan="2"
                            Grid.Column="1"
                            Padding="3,1,3,0">
                            <ContentPresenter
                                ContentSource="Header"
                                RecognizesAccessKey="true"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                        <ContentPresenter
                            Grid.Row="2"
                            Grid.Column="1"
                            Grid.ColumnSpan="2"
                            Margin="{TemplateBinding Padding}"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <Border
                            Grid.Row="1"
                            Grid.RowSpan="3"
                            Grid.ColumnSpan="4"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="0">
                            <Border.OpacityMask>
                                <MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="7">
                                    <Binding ElementName="Header" Path="ActualWidth" />
                                    <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
                                    <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
                                </MultiBinding>
                            </Border.OpacityMask>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--#endregion-->


</ResourceDictionary>