Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AncestorLevel Property
Collapse the table of content
Expand the table of content

RelativeSource.AncestorLevel Property

Gets or sets the level of ancestor to look for, in FindAncestor mode. Use 1 to indicate the one nearest to the binding target element.

Namespace:  System.Windows.Data
Assembly:  System.Windows (in System.Windows.dll)

'Declaration
Public Property AncestorLevel As Integer

Property Value

Type: System.Int32
The ancestor level. Use 1 to indicate the one nearest to the binding target element.

ExceptionCondition
ArgumentOutOfRangeException

When setting this property, the specified value is less than one.

If the Mode property is not set explicitly, setting the AncestorType or the AncestorLevel property will implicitly lock the Mode property value to FindAncestor.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft