开发者

WPF ListView double click

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

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜