DataContextValueSourceAttribute 생성자 (String, String, Boolean)
지정된 속성 이름, 상위 경로 및 컬렉션 정보를 사용하여 DataContextValueSourceAttribute 클래스의 새 인스턴스를 초기화합니다.
네임스페이스: Microsoft.Windows.Design
어셈블리: Microsoft.Windows.Design.Interaction(Microsoft.Windows.Design.Interaction.dll)
구문
‘선언
Public Sub New ( _
dataContextValueSourceProperty As String, _
ancestorPath As String, _
isCollectionItem As Boolean _
)
public DataContextValueSourceAttribute(
string dataContextValueSourceProperty,
string ancestorPath,
bool isCollectionItem
)
public:
DataContextValueSourceAttribute(
String^ dataContextValueSourceProperty,
String^ ancestorPath,
bool isCollectionItem
)
new :
dataContextValueSourceProperty:string *
ancestorPath:string *
isCollectionItem:bool -> DataContextValueSourceAttribute
public function DataContextValueSourceAttribute(
dataContextValueSourceProperty : String,
ancestorPath : String,
isCollectionItem : boolean
)
매개 변수
- dataContextValueSourceProperty
형식: System.String
데이터 컨텍스트 값의 소스인 속성의 이름입니다.
- ancestorPath
형식: System.String
데이터 컨텍스트 속성에 도달하기 위해 트래버스할 상위 속성의 집합을 나타내는 속성 경로입니다.
- isCollectionItem
형식: System.Boolean
데이터 컨텍스트가 컬렉션의 항목인지 여부를 나타냅니다.
설명
다음 XAML 조각은 여러 개의 다른 데이터 컨텍스트가 있는 트리를 보여 줍니다.
<ListView.View>
<GridView>
<GridViewColumn Header="Customer ID" Width="80">
<GridViewColumn.CellTemplate>
<DataTemplate>
다음 코드에서는 데이터 컨텍스트 상속 상위 경로를 지정하는 방법을 보여줍니다. builder는 AttributeTableBuilder 인스턴스에 대한 참조입니다. 이 코드는 CellTemplate 속성에 대한 속성 경로가 "보기", "열", ""이라고 지정합니다.
builder.AddCustomAttributes("CellTemplate", new DataContextPropertyAttribute("ItemsSource", @"(ListView.View).(GridView.Columns)\", true));
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.
참고 항목
참조
DataContextValueSourceAttribute 클래스
DataContextValueSourceAttribute 오버로드
Microsoft.Windows.Design 네임스페이스