zyzyis
zyzyis

Reputation: 213

WPF bug? MouseGesture on Single and DoubleClick

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.

Upvotes: 5

Views: 5117

Answers (1)

Eren Ers&#246;nmez
Eren Ers&#246;nmez

Reputation: 39095

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.

Upvotes: 1

Related Questions