<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!--  ComBoBox项鼠标经过背景色  -->
    <SolidColorBrush x:Key="ComboBoxMouseOverBackground" Color="#f0f0f0" />
    <!--  Combox右侧下拉按钮  -->
    <Style x:Key="ComboxStyleBtn" TargetType="ToggleButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <!--  下拉按钮内部背景色  -->
                    <Border
                        x:Name="Back"
                        Background="Transparent"
                        BorderBrush="Transparent"
                        BorderThickness="1">
                        <!--  下拉按钮内边框  -->
                        <Label
                            Name="PathFill"
                            Height="30"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Center"
                            VerticalContentAlignment="Center"
                            Content="ˇ"
                            FontSize="30" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Back" Property="Background" Value="Transparent" />
                            <Setter TargetName="Back" Property="BorderBrush" Value="Transparent" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--  Combox  -->
    <Style x:Key="ComboBoxStyle" TargetType="ComboBox">
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <!--  ComBoxItem  -->
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="MinHeight" Value="32" />
                    <Setter Property="MinWidth" Value="60" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                                <Border
                                    Name="_back"
                                    Background="Transparent"
                                    BorderBrush="#f3f3f3"
                                    BorderThickness="0,0,0,0">
                                    <ContentPresenter Margin="10,0,10,0" VerticalAlignment="Center" />
                                </Border>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter TargetName="_back" Property="Background" Value="{StaticResource ComboBoxMouseOverBackground}" />
                                    </Trigger>
                                    <!--  下拉框背景色  -->
                                    <Trigger Property="IsHighlighted" Value="True">
                                        <Setter TargetName="_back" Property="Background" Value="{StaticResource ComboBoxMouseOverBackground}" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <!--  文字区域背景和边线样式  -->
                        <TextBox
                            Grid.Column="0"
                            Padding="10,0,0,0"
                            VerticalAlignment="Center"
                            Background="Transparent"
                            BorderBrush="#c0c0c0"
                            BorderThickness="0"
                            Foreground="Black"
                            IsReadOnly="{TemplateBinding IsReadOnly}"
                            Text="{TemplateBinding Text}" />
                        <Border
                            Grid.Column="0"
                            BorderBrush="#c0c0c0"
                            BorderThickness="0.6"
                            CornerRadius="1,0,0,1" />
                        <!--  右侧下拉button设置  -->
                        <Border BorderThickness="0">
                            <ToggleButton
                                BorderBrush="Black"
                                BorderThickness="3"
                                ClickMode="Press"
                                IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                Style="{StaticResource ComboxStyleBtn}" />
                        </Border>
                        <!--  弹出popup整体设置  -->
                        <Popup
                            x:Name="Popup"
                            AllowsTransparency="True"
                            Focusable="False"
                            IsOpen="{TemplateBinding IsDropDownOpen}"
                            Placement="Bottom"
                            PopupAnimation="Slide">
                            <Grid
                                x:Name="DropDown"
                                Width="{TemplateBinding ActualWidth}"
                                MaxHeight="200"
                                SnapsToDevicePixels="True">
                                <Border
                                    x:Name="DropDownBorder"
                                    BorderBrush="#e8e8e8"
                                    BorderThickness="1,0,1,1" />
                                <ScrollViewer
                                    Margin="1"
                                    CanContentScroll="True"
                                    HorizontalScrollBarVisibility="Disabled"
                                    SnapsToDevicePixels="True"
                                    VerticalScrollBarVisibility="Auto">
                                    <!--  StackPanel 用于显示子级，方法是将 IsItemsHost 设置为 True  -->
                                    <StackPanel
                                        Background="White"
                                        IsItemsHost="True"
                                        KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
