how to get the coordinates of the UserControl element (that is, there are two ellipses on the usercontrol and you need to get the coordinates of one of them) relative to the canvas for example.
1 answer
Like that:
var point = myControl.TransformToVisual(myCanvas).Transform(new Point()); Where myControl is the element whose coordinates are to be obtained, and myCanvas is the element relative to which is to be obtained.
Keep in mind that this way you will get logical coordinates that are independent of the Windows scale settings.
|