title: Getting the item under mouse cursor in ListView
body: <p>This may looks like duplicate of <a href="https://stackoverflow.com/q/3788337/1997232">this</a> or <a href="https://stackoverflow.com/q/1045621/1997232">this</a> question. But my issue is what to do with obtained <code>ListViewItem</code>?</p>
  
  <p>I've set <code>ListView</code> binding like this</p>
  
  <pre><code>&lt;ListView ItemsSource="{Binding Data}" ...&gt;
  </code></pre>
  
  <p>where</p>
  
  <pre><code>public ObservableCollection&lt;Item&gt; Data { ... }
  </code></pre>
  
  <p>How do I get <code>Item</code> (from <code>ListViewItem</code>)?</p>
  
  <hr>
  
  <p>I tried to use mvvm and bind currently mouse-overed item similar to <a href="https://stackoverflow.com/q/15511752/1997232">this</a>. But then I stumbled even more:</p>
  
  <pre><code>&lt;ListView&gt;
      &lt;ListView.ItemContainerStyle&gt;
          &lt;Style TargetType="ListViewItem"&gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                      &lt;!-- this will not work --&gt;
                      &lt;Setter Property="{Binding MouseoveredItem, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}" Value="{Binding RelativeSource={RelativeSource Self}}"/&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/ListView.ItemContainerStyle&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>Is my intent clear? How do I get mouse-howered <code>Item</code>?</p>
  
  <hr>
  
  <p>I can't believe nobody has done this. Here is code-behind attempt (to illustrate my problem):</p>
  
  <pre><code>private void ListView_MouseMove(object sender, MouseEventArgs e)
  {
      var item = VisualTreeHelper.HitTest(listView, Mouse.GetPosition(listView)).VisualHit;
      // find ListViewItem (or null)
      while (item != null &amp;&amp; !(item is ListViewItem))
          item = VisualTreeHelper.GetParent(item);
      if (item != null)
      {
          ... // item is ListViewItem, how to convert ListViewItem it to Item
      }
  }
  </code></pre>
  
  <p>I can find <code>ListViewItem</code>, but I need properties of mouse-overed <code>Item</code>, which are displayed as <code>SubItems</code> or are hidden. How do I convert <code>ListViewItem</code> (visual view of <code>Item</code>) to <code>Item</code> (which is  this <code>ListViewItem</code> represents)?</p>