Why pointer events are not triggered in custom control? #19260
-
Many discussions talks about this question.😭 But I reset Bounds property of ICustomDrawOperation (I use it in overrided Render method to draw control directly), set HitTest Method not only in ICustomDrawOperation but also in ICustomHitTest (this is for my custom control).Pointer event still not be triggered. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
IIRC you need to draw a background with color (transparent works too) to make it pointer-interactive. |
Beta Was this translation helpful? Give feedback.
-
The control will receive pointer event with IsHitTestVisible (usually true) and with a non-null (non set) Background property. (usually not set) I have ended up by always setting up Background="Transparent" in my UserControl template code. |
Beta Was this translation helpful? Give feedback.
The control will receive pointer event with IsHitTestVisible (usually true) and with a non-null (non set) Background property. (usually not set)
I have ended up by always setting up Background="Transparent" in my UserControl template code.