/// <summary> /// Retrieve the input element at the given screen point. /// </summary> /// <param name="point">The point for hit testing.</param> /// <param name="window">The TouchWindow for hit testing.</param> /// <returns>UIElement result of the hit test. Null if no elements were located.</returns> private static UIElement GetElementAtScreenPoint(Point point, Window window) { if (!window.IsVisible) return null; Point windowPoint = window.PointFromScreen(point); IInputElement element = window.InputHitTest(windowPoint); // Console.WriteLine("[DEBUG-KCManager] "+ element.GetType()); if (element is UIElement) return (UIElement)element; else return null; }
private static UIElement GetElementAtScreenPoint(Point point, Window window) { if (!window.IsVisible) { return null; } Point windowPoint = window.PointFromScreen(point); IInputElement element = window.InputHitTest(windowPoint); if (element is UIElement) return (UIElement)element; else return null; }