ContainerVisual.ContentBounds Properti

Definisi

Mendapatkan kotak pembatas ContainerVisualuntuk konten .

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

Nilai Properti

Rect Yang menentukan kotak pembatas.

Contoh

Contoh berikut menunjukkan cara mengambil persegi panjang ContainerVisual pembatas objek.

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

Keterangan

DescendantBounds Gunakan properti untuk mengembalikan penyatuan semua kotak pembatas ContainerVisual konten untuk semua turunan objek, tetapi bukan objek itu sendiri.

Berlaku untuk