I have some user controls on a wpf form. I have set a trigger for them on IsMouseOverProperty
so that every time the mouse is over any of them, the Background color get changed. I also have a trigger of IsPressedProperty
so that every time that the user press the mouse button, the Background color get changed to another color.
Furthermore on the OnMouseLeftButtonDown
event I set this. CaptureMouse()
and in the OnPreviewMouseLeftButtonUp
event I set this.ReleaseMouseCapture()
so that when the user clicks anywhere else on the window, the the UserControl lost its mouse capture.
Every thing seems good so far unless when I press the mouse button on a user control and I move the mouse over the other user controls, their Background color never get changed because the mouse is captured by the control on which the mouse is captured.
Now I need to know is there any way to capture mouse on a user control and still be able to find if the mouse is over other controls?