VisualFindVisualAndAncestorsAspectT Method |
Find the first aspect of type T on this visual or one of its ancestors (parents, grand-parents, etc.).
Namespace: Demo3D.VisualsAssembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntaxpublic T FindVisualAndAncestorsAspect<T>()
where T : class
Type Parameters
- T
- The aspect type to look for.
Return Value
TThe first instance of aspect of type T in the hierarchy of this visual and visual above this visual, or null if not found.
ExampleBBox GetBoundsVisualAndAncestors(Visual visual) {
return visual.FindVisualAndAncestorsAspect<IRenderable>()?.BoundingBox;
}
See Also