RelativeSource コンストラクター

定義

RelativeSource クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
RelativeSource()

RelativeSource クラスの新しいインスタンスを初期化します。

RelativeSource(RelativeSourceMode)

初期モードを使用して、 RelativeSource クラスの新しいインスタンスを初期化します。

RelativeSource(RelativeSourceMode, Type, Int32)

目的の相対ソースを見つけるための初期モードと追加のツリー ウォーク修飾子を使用して、 RelativeSource クラスの新しいインスタンスを初期化します。

RelativeSource()

RelativeSource クラスの新しいインスタンスを初期化します。

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

適用対象

RelativeSource(RelativeSourceMode)

初期モードを使用して、 RelativeSource クラスの新しいインスタンスを初期化します。

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)

パラメーター

適用対象

RelativeSource(RelativeSourceMode, Type, Int32)

目的の相対ソースを見つけるための初期モードと追加のツリー ウォーク修飾子を使用して、 RelativeSource クラスの新しいインスタンスを初期化します。

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)

パラメーター

mode
RelativeSourceMode

RelativeSourceMode値の 1 つ。 この署名を関連させるためには、 FindAncestorする必要があります。

ancestorType
Type

検索する先祖の Type

ancestorLevel
Int32

指定された型のすべての先祖間の目的の先祖の序数位置。

次に、バインディングのターゲット要素から始まる上向きパスで検出された 2 番目の ItemsControl を返します。

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)

注釈

ancestorTypeancestorLevelは、mode以外のFindAncestorのパラメーターとして指定されている場合、関連性はありません。 このシグネチャは、他の RelativeSourceMode 値には使用しないでください。

適用対象