Share via


ContainerVisual.ContentBounds Proprietà

Definizione

Ottiene il riquadro delimitatore del testo per il contenuto dell'oggetto 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

Valore della proprietà

Rect

Oggetto Rect che specifica il riquadro delimitatore del testo.

Esempio

Nell'esempio seguente viene illustrato come recuperare il rettangolo di associazione di un ContainerVisual oggetto.

// 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)

Commenti

Utilizzare la DescendantBounds proprietà per restituire l'unione di tutte le caselle di selezione del contenuto per tutti i discendenti di un ContainerVisual oggetto, ma non dell'oggetto stesso.

Si applica a