ContainerVisual.DescendantBounds Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the union of all the content bounding boxes for all of the descendants of the ContainerVisual, but not including the contents of the ContainerVisual.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public Rect DescendantBounds { get; }

Property Value

Type: System.Windows.Rect

A Rect that specifies the combination bounding box.

Get the ContentBounds property to return the cached bounding box rectangle for the ContainerVisual itself.

The following example shows how to retrieve the bounding rectangle of a ContainerVisual object's descendants.

// Return the bounding rectangle for the ContainerVisual.
Rect rectBounds = containerVisual.ContentBounds;

// Expand the rectangle to include the bounding rectangle
// of the all of the ContainerVisual's descendants.

.NET Framework
Available since 3.0
Return to top