示例#1
0
        /// <summary>
        /// Returns the information if the given child is rendered at the given position.
        /// Panels will check their children in the given render order.
        /// Controls, which clip their render output at their boundaries or which hide individual children
        /// will check if the given child is shown.
        /// Other controls, wich don't clip their children's render output, will simply return the return value
        /// of their parent's <see cref="IsChildRenderedAt"/> method with <c>this</c> as argument.
        /// </summary>
        /// <param name="child">Child to check.</param>
        /// <param name="x">Absolute X coordinate to check.</param>
        /// <param name="y">Absolute Y coordinate to check.</param>
        /// <returns><c>true</c> if the given child of this element is rendered.</returns>
        public virtual bool IsChildRenderedAt(UIElement child, float x, float y)
        {
            UIElement parent = VisualParent as UIElement;

            return(parent == null ? true : parent.IsChildRenderedAt(this, x, y));
        }
示例#2
0
        /// <summary>
        /// Returns the information if the specified (absolute) coordinates are located in this element's range and
        /// this control is visible at the given coords.
        /// </summary>
        /// <param name="x">Absolute X-coordinate.</param>
        /// <param name="y">Absolute Y-coordinate.</param>
        /// <returns><c>true</c> if the specified coordinates lay in this element's visible range.</returns>
        public virtual bool IsInVisibleArea(float x, float y)
        {
            UIElement parent = VisualParent as UIElement;

            return(IsInArea(x, y) && (parent == null || parent.IsChildRenderedAt(this, x, y)));
        }