VisualExtensions.

CalculateDistanceFromAncestor(IVisual, IVisual) Method

Summary

Calculates the distance from a visual's IRenderRoot.
Namespace
Avalonia.VisualTree
Containing Type
VisualExtensions

Syntax

public static int CalculateDistanceFromAncestor(this IVisual visual, IVisual ancestor)

Parameters

Name Type Description
visual IVisual The visual.
ancestor IVisual The ancestor visual.

Return Value

Type Description
int The number of steps from the visual to the ancestor or -1 if visual is not a descendent of ancestor.