tags:

views:

30

answers:

2

I am using a dependency property to show a window, on double click of an item.

not sure whether it is a specific bug with WPF or I am doing something wrong.

If I double click even on the scroll bar or on the column headers.It triggers the double click command.

have tried a solution at ths link

http://stackoverflow.com/questions/2485091/wpf-listview-scrollviewer-double-click-event

but as i am implementing MVVM pattern, there is no code behind, and if i try to handle it on code behind, it triggers the debug point but thats of no use.

If any body has a solution for ths, do put up here.

A: 

Have you tried putting the double-click behaviour on the individual items and having the double-click logic handled in the DataTemplate/ControlTemplate instead of the ListView? That way, it should only trigger if you actually hit an item... thus exempting the empty area (if the ListView is smaller than the Window) and ScrollBars, borders etc.

Goblin
@Gobbin ya but implementing the code for every item would be diplicating the code. but that didnt even work..and I got the solution .. its at the following link http://www.codeproject.com/Articles/42111/Selector-DoubleClick-Behaviour-calling-ViewModel-I.aspxthis was the bihaviour i was exacly looking for.Thanks all.
crazy9
That is certainly elegant! Glad, you resolved it.
Goblin
A: 

I got a solution for this, after lot of googling... and Thanks to Sacha Barber..who has written the article of CodeProject, Here is the Link

http://www.codeproject.com/Articles/42111/Selector-DoubleClick-Behaviour-calling-ViewModel-I.aspx

crazy9