Property AncestorLevel
AncestorLevel
The level of ancestor to look for, in FindAncestor mode. Use 1 to indicate the one nearest to the target element.
public int AncestorLevel { get; set; }
Property Value
Remarks
if Mode has not been set explicitly, getting AncestorLevel will return -1 and setting AncestorLevel will implicitly lock Mode to FindAncestor.
Exceptions
- InvalidOperationException
RelativeSource is not in FindAncestor mode
- ArgumentOutOfRangeException
AncestorLevel cannot be set to less than 1