Click or drag to resize

VisualFindVisualAndDescendantsAspectsT Method

Find all aspects 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 IEnumerable<T> FindVisualAndDescendantsAspects<T>()
where T : class

Type Parameters

T
The aspect type to look for.

Return Value

Type: IEnumerableT
A collection of aspects of type T in the visual tree at this point and below.
Examples
C#
int CountRenderablesVisualAndDescendants(Visual visual) {
    // Count number of physics geometry aspects on this Visual and its descendants
    return visual.FindVisualAndDescendantsAspects<PhysicsGeometryAspect>().Count();
}
See Also