title: Change ListViewItem background colour on mouse over
body: <p>I need some help here. I can't understand why none of the solutions I found work for my case. Let's consider a Listview with these items:</p>
  
  <pre><code>&lt;ListView.Items&gt;
      &lt;ListViewItem&gt;
            &lt;TextBlock xml:space="preserve"&gt;  1 &lt;Bold&gt;I'm bold&lt;/Bold&gt;   &lt;/TextBlock&gt;
      &lt;/ListViewItem&gt;
      &lt;ListViewItem&gt;
            &lt;TextBlock  xml:space="preserve"&gt; 2 Im not &lt;/TextBlock&gt;
      &lt;/ListViewItem&gt;
  &lt;/ListView.Items&gt;
  </code></pre>
  
  <p>Initially on hover each row I saw the highlight of the TextBlock in its default light blue. It only underlined the area with text:<br>
  <a href="https://i.stack.imgur.com/edYza.png" rel="noreferrer"><img src="https://i.stack.imgur.com/edYza.png" alt=" "></a></p>
  
  <p>I don't want that highlight I want the one of the whole row, and I want to decide the colour. I also want the highlight of the whole row when selecting:
  <a href="https://i.stack.imgur.com/5K0N2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5K0N2.png" alt="enter image description here"></a></p>
  
  <p>I've been playing with Styles, Triggers or the ItemContainerStyle. I realized that I have to consider the background of the Textbox, and the one of the ListViewItem for the area with text. And the background of the whole row seems to be a business of the ListView.ItemContainerStyle. </p>
  
  <p>The result of adding a style fot the TextBox:</p>
  
  <pre><code>    &lt;Style x:Key="TextBlockStyle" TargetType="{x:Type TextBlock}"&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                 &lt;Setter Property="Foreground" Value="Black" /&gt;
                  &lt;Setter Property="Background" Value="White"/&gt; 
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  
  &lt;ListView Grid.Column="1" Margin="0" HorizontalContentAlignment="Stretch" BorderThickness="0" &gt;
          &lt;ListView.Resources&gt;
                  &lt;Style BasedOn="{StaticResource TextBlockStyle}" TargetType="{x:Type TextBlock}" /&gt;   
            &lt;/ListView.Resources&gt;
  </code></pre>
  
  <p>is: <a href="https://i.stack.imgur.com/tTIcQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tTIcQ.png" alt="enter image description here"></a></p>
  
  <p>Then I add another style to try to get rid of the ListView background under the TextBox:</p>
  
  <pre><code>    &lt;Style x:Key="ListViewItemStyle" TargetType="{x:Type ListViewItem}"&gt;
                      &lt;Style.Triggers&gt;
                          &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                              &lt;Setter Property="Background" Value="Gold" /&gt;
                          &lt;/Trigger&gt;
                      &lt;/Style.Triggers&gt;
       &lt;/Style&gt;
  
   &lt;ListView Grid.Column="1" Margin="0" HorizontalContentAlignment="Stretch" BorderThickness="0" &gt;
          &lt;ListView.Resources&gt;
                  &lt;Style BasedOn="{StaticResource TextBlockStyle}" TargetType="{x:Type TextBlock}" /&gt;
                   &lt;Style BasedOn="{StaticResource ListViewItemStyle}" TargetType="{x:Type ListViewItem}" /&gt;    
            &lt;/ListView.Resources&gt;
  </code></pre>
  
  <p>But this has no effect at all. </p>
  
  <p>And trying to highlight the whole row with this doesn't work:</p>
  
  <pre><code>&lt;ItemsControl.ItemContainerStyle&gt;
      &lt;Style&gt;
          &lt;Style.Triggers&gt;
                 &lt;Trigger Property="Control.IsMouseOver" Value="True"&gt;
                      &lt;Setter Property="Control.Background" Value="Gold" /&gt;
                          &lt;/Trigger&gt;
           &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  &lt;/ItemsControl.ItemContainerStyle&gt;
  </code></pre>
  
  <p>And tried several other suggestions for hours. This one: 
  <a href="https://stackoverflow.com/a/17189210/4674430">Remove the mouse over effect on a ListView in WPF</a> avoids the highlight over the text on hover,both for the TextBox and the ListViewItem, but I don't know how to change then the background of the whole row.
  Could someone provide an example of what I'm trying to do? </p>