共用方式為


ContainerVisual.DescendantBounds 屬性

定義

取得 ContainerVisual 之所有子代的所有內容週框方塊聯集,但不包括 ContainerVisual 的內容。

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

屬性值

Rect

指定組合週框方塊的 Rect

範例

下列範例示範如何擷取物件子系的周框 ContainerVisual

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

備註

ContentBounds取得 屬性,以傳回本身的 ContainerVisual 快取周框方塊矩形。

適用於