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

适用于