/// <summary>
        /// Checks if the event handler is capturing the mouse.
        /// </summary>
        /// <param name="handler">Event handler to check.</param>
        /// <returns>True if the handler captures the mouse.</returns>
        public static bool HasMouseCapture(this IEventHandler handler)
        {
            VisualElement ve = handler as VisualElement;

            return(ve.HasPointerCapture(PointerId.mousePointerId));
        }