RelativeSource 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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.
- 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)
설명
ancestorType가 ancestorLevel 아닌 mode다른 매개 변수로 지정된 경우 관련성이 FindAncestor 없습니다. 다른 RelativeSourceMode 값에는 이 서명을 사용하지 마세요.