RelativeSource Constructores

Definición

Inicializa una nueva instancia de la clase RelativeSource.

Sobrecargas

Nombre Description
RelativeSource()

Inicializa una nueva instancia de la clase RelativeSource.

RelativeSource(RelativeSourceMode)

Inicializa una nueva instancia de la RelativeSource clase con un modo inicial.

RelativeSource(RelativeSourceMode, Type, Int32)

Inicializa una nueva instancia de la RelativeSource clase con un modo inicial y calificadores adicionales de recorrido de árbol para encontrar el origen relativo deseado.

RelativeSource()

Inicializa una nueva instancia de la clase RelativeSource.

public:
 RelativeSource();
public RelativeSource();
Public Sub New ()

Se aplica a

RelativeSource(RelativeSourceMode)

Inicializa una nueva instancia de la RelativeSource clase con un modo inicial.

public:
 RelativeSource(System::Windows::Data::RelativeSourceMode mode);
public RelativeSource(System.Windows.Data.RelativeSourceMode mode);
new System.Windows.Data.RelativeSource : System.Windows.Data.RelativeSourceMode -> System.Windows.Data.RelativeSource
Public Sub New (mode As RelativeSourceMode)

Parámetros

mode
RelativeSourceMode

Uno de los RelativeSourceMode valores.

Se aplica a

RelativeSource(RelativeSourceMode, Type, Int32)

Inicializa una nueva instancia de la RelativeSource clase con un modo inicial y calificadores adicionales de recorrido de árbol para encontrar el origen relativo deseado.

public:
 RelativeSource(System::Windows::Data::RelativeSourceMode mode, Type ^ ancestorType, int ancestorLevel);
public RelativeSource(System.Windows.Data.RelativeSourceMode mode, Type ancestorType, int ancestorLevel);
new System.Windows.Data.RelativeSource : System.Windows.Data.RelativeSourceMode * Type * int -> System.Windows.Data.RelativeSource
Public Sub New (mode As RelativeSourceMode, ancestorType As Type, ancestorLevel As Integer)

Parámetros

mode
RelativeSourceMode

Uno de los RelativeSourceMode valores. Para que esta firma sea relevante, debe ser FindAncestor.

ancestorType
Type

de Type antecesor que se va a buscar.

ancestorLevel
Int32

Posición ordinal del antecesor deseado entre todos los antepasados del tipo especificado.

Ejemplos

A continuación, se devuelve el segundo ItemsControl encontrado en la ruta de acceso ascendente a partir del elemento de destino del enlace.

Binding myBinding = new Binding();
// Returns the second ItemsControl encountered on the upward path
// starting at the target element of the binding
myBinding.RelativeSource = new RelativeSource(
    RelativeSourceMode.FindAncestor, typeof(ItemsControl), 2);
Dim myBinding As New Binding()
' Returns the second ItemsControl encountered on the upward path
' starting at the target element of the binding
myBinding.RelativeSource = New RelativeSource(RelativeSourceMode.FindAncestor, GetType(ItemsControl), 2)

Comentarios

ancestorType y ancestorLevel no tienen relevancia si se proporcionan como parámetros para un mode valor distinto de FindAncestor. No use esta firma para los demás RelativeSourceMode valores.

Se aplica a