The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
VisualTreeHelper.GetContentBounds Method (Visual)
.NET Framework (current version)
Returns the cached bounding box rectangle for the specified Visual.
PresentationCore (in PresentationCore.dll)
public static Rect GetContentBounds(
Call the GetDescendantBounds method to return the union of all the content bounding boxes for all the descendants of a visual object, which includes the Visual itself.
The following example shows how to retrieve the bounding rectangle of a Visual object.
// Return the bounding rectangle of the parent visual object and all of its descendants.
Rect rectBounds = VisualTreeHelper.GetDescendantBounds(parentVisual);
Return to top
Available since 3.0