RelativeSource.Mode Property

Definition

Gets or sets a RelativeSourceMode value that describes the location of the binding source relative to the position of the binding target.

C#
public System.Windows.Data.RelativeSourceMode Mode { get; set; }

Property Value

One of the RelativeSourceMode values. The default value is null.

Exceptions

This property is immutable after initialization. Instead of changing the Mode on this instance, create a new RelativeSource or use a different static instance.

Remarks

This property is read-only after initialization. If this property is not set explicitly, setting the AncestorType or the AncestorType and the AncestorLevel properties will implicitly lock this property value to FindAncestor.

XAML Text Usage

For XAML information, see RelativeSource MarkupExtension.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also