Exemplo n.º 1
0
        /// <summary>
        /// GetDrawing - Returns the drawing content of this Visual.
        /// </summary>
        /// <remarks>
        /// Changes to this DrawingGroup will not be propagated to the Visual's content.
        /// This method is called by both the Drawing property, and VisualTreeHelper.GetDrawing()
        /// </remarks>
        internal override DrawingGroup GetDrawing()
        {
            // Need to determine if Visual.Drawing should return mutable content

            VerifyAPIReadOnly();

            DrawingGroup drawingGroupContent = null;

            // Convert our content to a DrawingGroup, if content exists
            if (_content != null)
            {
                drawingGroupContent = DrawingServices.DrawingGroupFromRenderData((RenderData)_content);
            }

            return(drawingGroupContent);
        }
        /// <summary>
        /// GetDrawing - Returns the drawing content of this Visual.
        /// </summary>
        /// <remarks>
        /// Changes to this DrawingGroup will not be propagated to the Visual's content.
        /// This method is called by both the Drawing property, and VisualTreeHelper.GetDrawing()
        /// </remarks>
        internal override DrawingGroup GetDrawing()
        {
            //


            VerifyAPIReadOnly();

            DrawingGroup drawingGroupContent = null;

            // Convert our content to a DrawingGroup, if content exists
            if (_content != null)
            {
                drawingGroupContent = DrawingServices.DrawingGroupFromRenderData((RenderData)_content);
            }

            return(drawingGroupContent);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Hit-tests a geometry against this content
 /// </summary>
 /// <param name="geometry"> PathGeometry to hit-test for. </param>
 /// <returns>
 /// IntersectionDetail describing the result of the hit-test
 /// </returns>
 IntersectionDetail IDrawingContent.HitTestGeometry(PathGeometry geometry)
 {
     return(DrawingServices.HitTestGeometry(this, geometry));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Determines whether or not a point exists within the content
 /// </summary>
 /// <param name="point"> Point to hit-test for. </param>
 /// <returns>
 /// 'true' if the point exists within the content, 'false' otherwise
 /// </returns>
 bool IDrawingContent.HitTestPoint(Point point)
 {
     return(DrawingServices.HitTestPoint(this, point));
 }