Do I fail to trigger other mouse events when I press the mouse? #17866
-
The description in the gif is not accurate enough, let me redescribe it when I hold down this control and move the mouse somewhere else, If I simply move the mouse, the events for these controls will fire normally what should I do if I want to trigger other pointer events when I hold down the mouse
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Those PointerMoved events will only go to the pressed NodeJunction because it will Capture the Pointer during Pointer Pressed. You could undo that like so in your protected override void OnPointerPressed(PointerPressedEventArgs e)
{
base.OnPointerPressed(e);
e.Pointer.Capture(null);
} Now when you move the pointer to another NodeJuntionView it will get the PointerMoved. But I do not know what negative side-effects this technique could have. You should check for that. |
Beta Was this translation helpful? Give feedback.
Another technique, without releasing the capture, could be to make a custom event; like a
ConnectingEnterEvent
and aConnectingExitEvent
. And in the PointerMoved of the capturedNodeJunctionView
you find the underlyingNodeJunctionView
(find it using InputElementInputHitTest()
and raise aConnectingEnter/ExitEvent
on it. ThatNodeJunctionView
can then catch that event, and for instance set a pseudoclass like ":connecting", which you can then use to do some styling on it.