/// <summary> /// Returns the bounding box occupied by the content /// </summary> /// <returns> /// Bounding box occupied by the content /// </returns> public Rect GetContentBounds(BoundsDrawingContextWalker ctx) { Debug.Assert(ctx != null); DrawingContextWalk(ctx); return(ctx.Bounds); }
/// <summary> /// Returns the bounding box occupied by the content /// </summary> /// <returns> /// Bounding box occupied by the content /// </returns> Rect IDrawingContent.GetContentBounds(BoundsDrawingContextWalker ctx) { Debug.Assert(ctx != null); WalkCurrentValue(ctx); return(ctx.Bounds); }
/// <summary> /// GetBounds to calculate the bounds of this drawing. /// </summary> internal Rect GetBounds() { BoundsDrawingContextWalker ctx = new BoundsDrawingContextWalker(); WalkCurrentValue(ctx); return(ctx.Bounds); }
/// <summary> /// Returns the bounding box of the content. /// </summary> internal override Rect GetContentBounds() { if (_content != null) { Rect resultRect = Rect.Empty; MediaContext mediaContext = MediaContext.From(Dispatcher); BoundsDrawingContextWalker ctx = mediaContext.AcquireBoundsDrawingContextWalker(); resultRect = _content.GetContentBounds(ctx); mediaContext.ReleaseBoundsDrawingContextWalker(ctx); return(resultRect); } else { return(Rect.Empty); } }
/// <summary> /// Returns the bounding box occupied by the content /// </summary> /// <returns> /// Bounding box occupied by the content /// </returns> public Rect GetContentBounds(BoundsDrawingContextWalker ctx) { Debug.Assert(ctx != null); DrawingContextWalk(ctx); return ctx.Bounds; }
/// <summary> /// Set the BoundsDrawingContextWalker for next use /// To handle reentrance we want to make sure that /// no one else on the same thread gets the same context. /// </summary> internal void ReleaseBoundsDrawingContextWalker(BoundsDrawingContextWalker ctx) { _cachedBoundsDrawingContextWalker = ctx; }
/// <summary> /// Returns the bounding box occupied by the content /// </summary> /// <returns> /// Bounding box occupied by the content /// </returns> Rect IDrawingContent.GetContentBounds(BoundsDrawingContextWalker ctx) { Debug.Assert(ctx != null); WalkCurrentValue(ctx); return ctx.Bounds; }
/// <summary> /// GetBounds to calculate the bounds of this drawing. /// </summary> internal Rect GetBounds() { BoundsDrawingContextWalker ctx = new BoundsDrawingContextWalker(); WalkCurrentValue(ctx); return ctx.Bounds; }