Bagikan melalui


RelativeSourceMode Enumeration

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Defines constants that describe the location of the binding source relative to the position of the binding target.

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

Syntax

'Declaration
Public Enumeration RelativeSourceMode
public enum RelativeSourceMode
See Remarks

Members

Member name Description
Supported by Silverlight for Windows Phone TemplatedParent Refers to the element to which the template (in which the data-bound element exists) is applied. This is similar to setting a TemplateBinding Markup Extension and is only applicable if the Binding is within a template.
Supported by Silverlight for Windows Phone Self Refers to the element on which you are setting the binding and allows you to bind one property of that element to another property on the same element.
FindAncestor Refers to the ancestor in the parent chain of the data-bound element. You can use this to bind to an ancestor of a specific type or its subclasses. This is the mode you use if you want to specify RelativeSource.AncestorType and/or AncestorLevel.

Remarks

This class is used by the RelativeSource.Mode property.

For XAML usage of RelativeSourceMode, see RelativeSource Markup Extension.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

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