Share via


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)

매개 변수

mode
RelativeSourceMode

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 값 중 하나입니다. 이 시그니처와 관련되게 하려면 이 값이 FindAncestor여야 합니다.

ancestorType
Type

찾을 상위 항목의 Type입니다.

ancestorLevel
Int32

지정된 형식의 모든 상위 항목 중 원하는 상위 항목의 위치입니다.

예제

다음 두 번째 반환 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 값입니다.

적용 대상