Replies: 1 comment 5 replies
-
To transform the coordinates of an element relative to another in Uno Platform (and WinUI/UWP...), you can use the You Stack Overflow article is the right way to go. // Assume sourceElement and targetElement are your UIElements
var transform = sourceElement.TransformToVisual(targetElement);
// Local coordinates in sourceElement
var pointInSourceElement = new Point(x, y);
// Coordinates in targetElement
var pointInTargetElement = transform.TransformPoint(pointInSourceElement);
// pointInTargetElement now contains the coordinates in the context of targetElement |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We can do PointToScreen in WinForm or WPF by https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.pointtoscreen?view=windowsdesktop-8.0 and https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.visual.pointtoscreen?view=windowsdesktop-8.0
But I can not find the equivalent of method in UNO.
And the https://stackoverflow.com/a/38580862 does not seem to help.
Beta Was this translation helpful? Give feedback.
All reactions