title: Removing ListBoxItem background for right click events
body: <p>I have managed to prevent the <code>ListBox</code> item background from displaying on hover and selection, however, it appears when I right click an item and then even shows the background on hover when the <code>ListBox</code> has focus again (for the element that was previously right clicked).</p>
  
  <p>I can't use <code>e.Handled = true</code> in <code>ListBoxPreviewMouseDown</code> as that breaks my right click context menus. By break, I mean that it prevents the menu items from reacting to clicks. The context menu displays fine, but cannot invoke the item clicks.</p>
  
  <p>What am I missing to also cover the <code>ListBoxItem</code> background not displaying upon right click?</p>
  
  <p>Thank you.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;!-- Style --&gt;
  &lt;Style TargetType="ListBoxItem" x:Key="MyListBoxItemStyle"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type ListBoxItem}"&gt;
                  &lt;Border x:Name="Bd"
                  Background="{TemplateBinding Background}"
                  BorderBrush="{TemplateBinding BorderBrush}"
                  BorderThickness="{TemplateBinding BorderThickness}"
                  Padding="{TemplateBinding Padding}"
                  SnapsToDevicePixels="True"&gt;
                      &lt;ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                  Content="{TemplateBinding Content}"
                                  ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /&gt;
                  &lt;/Border&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;MultiTrigger&gt;
                          &lt;MultiTrigger.Conditions&gt;
                              &lt;Condition Property="IsMouseOver" Value="True" /&gt;
                          &lt;/MultiTrigger.Conditions&gt;
                          &lt;Setter TargetName="Bd" Property="Background" Value="Transparent" /&gt;
                          &lt;Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" /&gt;
  
                      &lt;/MultiTrigger&gt;
                      &lt;MultiTrigger&gt;
                          &lt;MultiTrigger.Conditions&gt;
                              &lt;Condition Property="Selector.IsSelectionActive" Value="False" /&gt;
                              &lt;Condition Property="IsSelected" Value="True" /&gt;
                          &lt;/MultiTrigger.Conditions&gt;
                          &lt;Setter TargetName="Bd" Property="Background" Value="Transparent" /&gt;
                          &lt;Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" /&gt;
                      &lt;/MultiTrigger&gt;
                      &lt;MultiTrigger&gt;
                          &lt;MultiTrigger.Conditions&gt;
                              &lt;Condition Property="Selector.IsSelectionActive" Value="True" /&gt;
                              &lt;Condition Property="IsSelected" Value="True" /&gt;
                          &lt;/MultiTrigger.Conditions&gt;
                          &lt;Setter TargetName="Bd" Property="Background" Value="Transparent" /&gt;
                          &lt;Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" /&gt;
                      &lt;/MultiTrigger&gt;
                      &lt;Trigger Property="IsEnabled" Value="False"&gt;
                          &lt;Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  
  &lt;!-- Listbox --&gt;
  
  &lt;ListBox Name="ListBoxOne"&gt;
          &lt;ListBox.Style&gt;
              &lt;Style&gt;
                  &lt;Style.Triggers&gt;
                      &lt;Trigger Property="ListBox.IsMouseOver" Value="True"&gt;
                          &lt;Setter 
                              Property="ListBox.ItemContainerStyle" 
                              Value="{StaticResource MyListBoxItemStyle}"/&gt;
                      &lt;/Trigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/ListBox.Style&gt;
      &lt;/userControls:ListBox&gt;
  </code></pre>