tags:

views:

1295

answers:

4

I know there is a mouse click event for every control but is there a way to determine when the mouse click is not on the control?

A: 

In WinForms it's MouseUp. Is there anything like that in WPF?

Neil Barnwell
A: 

you can check the IsMouseOver for false, and if you want to hook an action when the IsMouseOver == false, you can override the metadata of that dp.

abdelkrimnet
A: 

you could use this code to find all controls or target type of visual element on the window and handle it's mouse events.

Andrija
A: 

You can call CaptureMouse and then that object will receive all mouse events. You can then determine from the point of the mouse down whether it was within the bounds of your control or not. Or you can listen for the LostMouseCapture event instead.

Alex