Share via


ContainerVisual.ContentBounds Propriété

Définition

Obtient le cadre englobant pour le contenu du ContainerVisual.

public:
 property System::Windows::Rect ContentBounds { System::Windows::Rect get(); };
public System.Windows.Rect ContentBounds { get; }
member this.ContentBounds : System.Windows.Rect
Public ReadOnly Property ContentBounds As Rect

Valeur de propriété

Rect

Rect qui spécifie le cadre englobant.

Exemples

L’exemple suivant montre comment récupérer le rectangle englobant d’un ContainerVisual objet.

// 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.
rectBounds.Union(containerVisual.DescendantBounds);
' Return the bounding rectangle for the ContainerVisual.
Dim rectBounds As Rect = containerVisual.ContentBounds

' Expand the rectangle to include the bounding rectangle
' of the all of the ContainerVisual's descendants.
rectBounds.Union(containerVisual.DescendantBounds)

Remarques

Utilisez la DescendantBounds propriété pour retourner l’union de tous les rectangles englobants de contenu pour tous les descendants d’un ContainerVisual objet, mais pas l’objet lui-même.

S’applique à