Pointer events in Control vs. Panel. #9794
sonicsmooth
started this conversation in
General
Replies: 2 comments
-
You need any kind of Background for hit testing to work. Transparent is fine, but null will not work. For Panel, null is default. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks, I figured this is by design. I'm just using a Panel with defined background. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to capture the mouse movement in a custom control for dragging, etc., so I derive from
Control
since no Children.When I don't draw anything in
Render
, there are no mouse movements captured.The only way I get mouse events is when the mouse goes over something that has been drawn in
Render
, such as individual lines (I get quick littlePointerEnter
andPointerLeave
events when mouse crosses a line) or shapes, and I don't get any click events unless I'm over a drawn pixel somewhere.I can draw a large rectangle to capture the mouse, or alternately derive from Panel and define a (possibly transparent) Background in .xaml, which seems to have the same effect as me just drawing a rectangle.
Is this expected? Is there any way to get mouse events from a completely blank Control?
My current solution is to derive from Panel (even though I [currently] don't have any Children here), and then specify a blank background.
Beta Was this translation helpful? Give feedback.
All reactions