RelativeSource Class

RelativeSource Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Implements a markup extension that describes the location of the binding source relative to the position of the binding target.

System.Object
  System.Windows.Data.RelativeSource

Namespace:  System.Windows.Data
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public class RelativeSource
See Remarks

The RelativeSource type exposes the following members.

  NameDescription
Public methodRelativeSource()Initializes a new instance of the RelativeSource class by using the default relative source mode.
Public methodRelativeSource(RelativeSourceMode)Initializes a new instance of the RelativeSource class by using the specified relative source mode.
Top

  NameDescription
Public propertyModeGets or sets a value that describes the location of the binding source relative to the position of the binding target.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

For XAML usage of RelativeSource, see RelativeSource markup extension.

RelativeSource is a class that supports a XAML markup extension. Markup extensions are typically implemented when there is a requirement to escape attribute values to be other than literal values or to use type converters. All markup extensions in XAML use curly braces ({}) in their attribute syntax, which is the convention by which a XAML processor recognizes that a markup extension must process the attribute. For more information, see the "Markup Extensions" section of XAML for Windows Phone 8. The RelativeSource markup extension is specifically required for setting the Binding.RelativeSource property as a XAML attribute.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2016 Microsoft