<Styles xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Design.PreviewWith>
    <Border Padding="0">
      <ListBox>
        <ListBoxItem IsEnabled="False">Disabled</ListBoxItem>
        <ListBoxItem Background="#66000000"
                     Padding="20">
          Test
        </ListBoxItem>
        <ListBoxItem>Test</ListBoxItem>
      </ListBox>
    </Border>
  </Design.PreviewWith>
  <Styles.Resources>
    <Thickness x:Key="ListBoxItemPadding">12,9,12,12</Thickness>
  </Styles.Resources>
  <Style Selector="ListBoxItem">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="Padding" Value="{DynamicResource ListBoxItemPadding}" />
    <Setter Property="Template">
      <ControlTemplate>
        <ContentPresenter Name="PART_ContentPresenter"
                          Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          CornerRadius="{TemplateBinding CornerRadius}"
                          ContentTemplate="{TemplateBinding ContentTemplate}"
                          Content="{TemplateBinding Content}"
                          Padding="{TemplateBinding Padding}"
                          VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                          HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
      </ControlTemplate>
    </Setter>
  </Style>

  <Style Selector="ListBoxItem /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="FontWeight" Value="Normal" />
    <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
  </Style>

  <!--  Disabled State  -->
  <Style Selector="ListBoxItem:disabled /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Foreground" Value="{DynamicResource SystemControlDisabledBaseMediumLowBrush}" />
  </Style>

  <!--  PointerOver State  -->
  <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
  </Style>
  <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
  </Style>

  <!--  Pressed State  -->
  <Style Selector="ListBoxItem:pressed /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" />
  </Style>
  <Style Selector="ListBoxItem:pressed /template/ ContentPresenter">
    <Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
  </Style>

  <!--  Selected State  -->
  <Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" />
  </Style>
  <Style Selector="ListBoxItem:selected /template/ ContentPresenter">
    <Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
  </Style>

  <!--  Selected Unfocused State  -->
  <Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" />
  </Style>
  <Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
  </Style>

  <!--  Selected PointerOver State  -->
  <Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
  </Style>
  <Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter">
    <Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
  </Style>

  <!--  Selected Pressed State  -->
  <Style Selector="ListBoxItem:selected:pressed /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentHighBrush}" />
  </Style>
  <Style Selector="ListBoxItem:selected:pressed /template/ ContentPresenter#PART_ContentPresenter">
    <Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
  </Style>
</Styles>
