Esempio n. 1
0
        public static Point GetCursorPos(UIElement element)
        {
            Point point = GetCursorPos();
            point = element.PointFromScreen(point);

            return point;
        }
Esempio n. 2
0
 /// <summary>
 ///  Calculates the position of the mouse relative to a particular element. 
 /// </summary>
 public Point GetPosition(UIElement relativeTo)
 {
     return relativeTo.PointFromScreen(ScreenPosition);
 }