Show / Hide Table of Contents

Class RelativeSource

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

Inheritance
System.Object
MarkupExtension
RelativeSource
Implements
IMarkupExtension<System.Object>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Data
Assembly: OpenSilver.dll
Syntax
public class RelativeSource : MarkupExtension, IMarkupExtension<object>

Constructors

| Improve this Doc View Source

RelativeSource()

Initializes a new instance of the RelativeSource class by using default relative source mode.

Declaration
public RelativeSource()
| Improve this Doc View Source

RelativeSource(RelativeSourceMode)

Initializes a new instance of the RelativeSource class by using provided relative source mode.

Declaration
public RelativeSource(RelativeSourceMode relativeSourceMode)
Parameters
Type Name Description
RelativeSourceMode relativeSourceMode

The relative source mode

Properties

| Improve this Doc View Source

AncestorLevel

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

Declaration
public int AncestorLevel { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

AncestorType

Gets or sets the type of ancestor to look for.

Declaration
public Type AncestorType { get; set; }
Property Value
Type Description
System.Type
| Improve this Doc View Source

Mode

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

Declaration
public RelativeSourceMode Mode { get; set; }
Property Value
Type Description
RelativeSourceMode

Methods

| Improve this Doc View Source

ProvideValue(IServiceProvider)

Declaration
public override object ProvideValue(IServiceProvider serviceProvider)
Parameters
Type Name Description
System.IServiceProvider serviceProvider
Returns
Type Description
System.Object
Overrides
MarkupExtension.ProvideValue(IServiceProvider)

Implements

IMarkupExtension<T>
  • Improve this Doc
  • View Source