Click or drag to resize

VisualFindVisualAndDescendantsAspectT Method

Find the first aspect of type T on this visual or one of its descendents (children recursively)

Namespace:  Demo3D.Visuals
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 15.0.2.11458
Syntax
C#
public T FindVisualAndDescendantsAspect<T>()
where T : class

Type Parameters

T
The aspect type to look for.

Return Value

Type: T
An aspect of type T, or null if none found.
Examples
C#
BBox GetBoundsVisualAndDescendants(Visual visual) {
    // Get the bounding box of the first IRenderable or its closest descendant (or null if there isn't one)
    return visual.FindVisualAndDescendantsAspect<IRenderable>()?.BoundingBox;
}
See Also