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.

Inheritance Hierarchy

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.

Syntax

Public Class RelativeSource
public class RelativeSource
See Remarks

The RelativeSource type exposes the following members.

Constructors

  Name Description
RelativeSource()()() Initializes a new instance of the RelativeSource class by using the default relative source mode.
RelativeSource(RelativeSourceMode) Initializes a new instance of the RelativeSource class by using the specified relative source mode.

Top

Properties

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

Top

Methods

  Name Description
Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
GetType Gets the Type of the current instance. (Inherited from Object.)
MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

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.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

Thread Safety

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

See Also

Reference

System.Windows.Data Namespace

RelativeSource