RelativeSource 생성자

정의

RelativeSource 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
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 값에는 이 서명을 사용하지 마세요.

적용 대상