2
votes

We have implemented a simple InputBinding for mouse click gestures, the code is something like below:

<Image.InputBindings>
    <MouseBinding MouseAction="LeftClick" Command="{Binding OpenDialogCommand}" />
    <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding OpenDialogCommand}" />
</Image.InputBindings>

We expected that WPF is able to recognize Left and LeftDouble gestures and do the respective command. But in practice we found that the Left Click is evaluated first and the second click of the double click is treated as another single click. Since our command is to open a dialog doing a doubleclick will quickly open and close our dialog.

Does anyone meet such thing before?

Thanks.

S.

1
Old question, same problem! What I'm experiencing with this dual-input binding on a TextBlock is actually the sequence: CLICK CLICK DOUBLECLICK. The events are also processed on Mouse DOWN, not mouse UP. I've looked around a bit and haven't yet found a simple solution for isolating these events. - cod3monk3y
Works for TextBlock. - Sasha Yakobchuk

1 Answers

1
votes

I think this is the desired behavior. Note that it is a LeftClick event, which doesn't necessarily mean "LeftSingleClick". You should check out the Snoop utility for investigating exactly which events are getting triggered.