Beispiel #1
0
        public static IInputElement?InputHitTest(
            this IInputElement element,
            Point p,
            Func <IVisual, bool> filter)
        {
            element = element ?? throw new ArgumentNullException(nameof(element));
            filter  = filter ?? throw new ArgumentNullException(nameof(filter));

            return(element.GetVisualAt(p, x => s_hitTestDelegate(x) && filter(x)) as IInputElement);
        }
Beispiel #2
0
        /// <summary>
        /// Returns the topmost active input element at a point on an <see cref="IInputElement"/>.
        /// </summary>
        /// <param name="element">The element to test.</param>
        /// <param name="p">The point on <paramref name="element"/>.</param>
        /// <returns>The topmost <see cref="IInputElement"/> at the specified position.</returns>
        public static IInputElement InputHitTest(this IInputElement element, Point p)
        {
            Contract.Requires <ArgumentNullException>(element != null);

            return(element.GetVisualAt(p, s_hitTestDelegate) as IInputElement);
        }
Beispiel #3
0
        public static IInputElement?InputHitTest(this IInputElement element, Point p)
        {
            element = element ?? throw new ArgumentNullException(nameof(element));

            return(element.GetVisualAt(p, s_hitTestDelegate) as IInputElement);
        }