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

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