There is a UI object on the page, how can I determine the mouse coordinates relative to this object on the PointerEntered event? My task is to display the resize cursor in the correct position. I kind of get the coordinates of the object and the mouse, but when, as I think, I move the mouse to 0: 0 and my object is there, the coordinates are different
My method
private void Border_PointerEntered(object sender, PointerRoutedEventArgs e) { var border = sender as Border; var ct = (CompositeTransform)border.RenderTransform; var ttv = border.TransformToVisual(Window.Current.Content); var bordercoords = ttv.TransformPoint(new Point(0, 0)); var borderHeight = border.ActualHeight+ct.ScaleY; var borderWidth = border.ActualWidth+ct.ScaleX; var mouseAbsoluteCoords = Window.Current.CoreWindow.PointerPosition; if (bordercoords.Y -3>=mouseAbsoluteCoords.Y || mouseAbsoluteCoords.Y <= bordercoords.Y+3 && mouseAbsoluteCoords.X > bordercoords.X + 10 && mouseAbsoluteCoords.X < borderWidth - 10) { Window.Current.CoreWindow.PointerCursor = bottomTopCursor; } } I try to cover the upper border with a check, I imagine it this way: when the cursor is in the blue zone, the necessary cursor is activated. Similarly for other areas
