Click or drag to resize

VisualFindVisualAndAncestorsAspectsT Method

Finds all aspects of type T on this visual or its ancestors.

Namespace:  Demo3D.Visuals
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 15.0.2.11458
Syntax
C#
public IEnumerable<T> FindVisualAndAncestorsAspects<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 above.
Examples
C#
int CountRenderablesVisualAndAncestors(Visual visual) {
    // Count number of physics geometry aspects on this Visual and its ancestors
    return visual.FindVisualAndAncestorsAspects<PhysicsGeometryAspect>().Count();
}
See Also