<ResourceDictionary xmlns="https://github.com/avaloniaui"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <ControlTheme x:Key="{x:Type ComboBox}"
                TargetType="ComboBox">
    <Setter Property="Background" Value="{DynamicResource ThemeControlLowBrush}" />
    <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}" />
    <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
    <Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" />
    <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Padding" Value="4" />
    <Setter Property="MinHeight" Value="20" />
    <Setter Property="PlaceholderForeground" Value="{DynamicResource ThemeForegroundBrush}" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
    <Setter Property="Template">
      <ControlTemplate>
        <Border Name="border"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                CornerRadius="{TemplateBinding CornerRadius}">
          <Grid ColumnDefinitions="*,Auto">
            <TextBlock Name="PlaceholderTextBlock"
                       Grid.Column="0"
                       Margin="{TemplateBinding Padding}"
                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                       Foreground="{TemplateBinding PlaceholderForeground}"
                       IsVisible="{TemplateBinding SelectionBoxItem,
                                                   Converter={x:Static ObjectConverters.IsNull}}"
                       Text="{TemplateBinding PlaceholderText}" />
            <ContentControl Margin="{TemplateBinding Padding}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding SelectionBoxItem}"
                            ContentTemplate="{TemplateBinding ItemTemplate}" />
            <ToggleButton Name="toggle"
                          Grid.Column="1"
                          Background="Transparent"
                          BorderThickness="0"
                          ClickMode="Press"
                          Focusable="False"
                          IsChecked="{TemplateBinding IsDropDownOpen,
                                                      Mode=TwoWay}">
              <Path Width="8"
                    Height="4"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z"
                    Fill="{DynamicResource ThemeForegroundBrush}"
                    Stretch="Uniform" />
            </ToggleButton>
            <Popup Name="PART_Popup"
                   MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
                   MaxHeight="{TemplateBinding MaxDropDownHeight}"
                   IsLightDismissEnabled="True"
                   IsOpen="{TemplateBinding IsDropDownOpen,
                                            Mode=TwoWay}"
                   PlacementTarget="{TemplateBinding}">
              <Border Background="{DynamicResource ThemeBackgroundBrush}"
                      BorderBrush="{DynamicResource ThemeBorderMidBrush}"
                      BorderThickness="1">
                <ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                              VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
                  <ItemsPresenter Name="PART_ItemsPresenter"
                                  ItemsPanel="{TemplateBinding ItemsPanel}"/>
                </ScrollViewer>
              </Border>
            </Popup>
          </Grid>
        </Border>
      </ControlTemplate>
    </Setter>
    <Style Selector="^:pointerover /template/ Border#border">
      <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}" />
    </Style>
    <Style Selector="^:disabled /template/ Border#border">
      <Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
    </Style>
  </ControlTheme>
</ResourceDictionary>