I need to be able to handle the double click and single click event on the WPF StackPanel. But there is no such thing as the StackPanel’s DoubleClick Event.
I want to do 2 different operations in these 2 EventHandlers.
Any idea how to do that?
Thank you
The best way is to write your own mouse button handler with a timeout – if the event is fired again within the timeout period, then fire your doubleclick message, otherwise call the single click handler. Here’s some sample code (Edit: originally found here):
Then, in the control you want to receive the events: