Replies: 3 comments 4 replies
-
Figured it out. https://github.com/dotnet/maui/tree/main/src/Core/src/WindowOverlay Has all the methods for accessing click and touch data in a way that corresponds to Thank god (or whoever made it) for that class as I would have gone crazy trying to figure it out all on my own. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. I want to define another movable pointer (that is different from the OS-pointer). For this new pointer, I need to know what elements (like buttons) lie beneath it, in order to be able to trigger events and apply actions. |
Beta Was this translation helpful? Give feedback.
-
Thanks jonmdev. Using "VisualTreeElementExtensions.GetVisualTreeElements(veToGetFrom, pos)" I am able to iterate through the found elements and find the one underlying button. It works very well when the pangesture (pointer moving) is completed. With GestureStatus.Running, the movement of the cursor gets laggy and is not smooth anymore. Now the next step will be to fire button events like PointerEntered (in order to give that button some visible focus), PointerExited and Clicked. Probably a custom behavior would be suitable for that, or a trigger? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to develop my own Gesture/Click methods using
GetVisualTreeElements(point)
here: https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.ivisualtreeelement?view=net-maui-7.0However, results of my preliminary testing show this doesn't match up to
VisualElement.Bounds
. Ie. UsingGetVisualTreeElements(point)
with a point that should be within an element's bounds does not return that object.It says on that page re: using a rectangle as an input, the input is "defined by its coordinates which are specified in platform units, not pixels." I am guessing this applies for using a Point as well.
I cannot find any information on what a "platform unit" is or how to convert this to pixels. Any guidance or resource? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions