WPF ListView ScrollViewer Double-Click Event

Posted by Sentax on Stack Overflow See other posts from Stack Overflow or by Sentax
Published on 2010-03-20T22:47:33Z Indexed on 2010/03/20 22:51 UTC
Read the original article Hit count: 1784

Doing the below will reproduce my problem:

  • New WPF Project
  • Add ListView
  • Name the listview: x:Name="lvList"
  • Add enough ListViewItems to the ListView to fill the list completely so a vertical scroll-bar appears during run-time.
  • Put this code in the lvList.MouseDoubleClick event

Debug.Print("Double-Click happened")

  • Run the application
  • Double-click on the LargeChange area of the scroll-bar (Not the scroll "bar" itself)
  • Notice the Immediate window printing the double-click happened message for the ListView

How do I change this behavior so MouseDoubleClick only happens when the mouse is "over" the ListViewItems and not when continually clicking the ScrollViewer to scroll down/up in the list?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about scrollviewer