BindableAttribute.Bindable 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
속성이 바인딩에 일반적으로 사용됨을 나타내는 값을 가져옵니다.
public:
property bool Bindable { bool get(); };
public bool Bindable { get; }
member this.Bindable : bool
Public ReadOnly Property Bindable As Boolean
속성 값
true속성이 바인딩에 일반적으로 사용되면 이고, 그렇지 않으면 . false
예제
다음 코드 예제에서는 바인딩할 수 있는지 여부를 MyProperty 확인합니다. 먼저 코드는 다음을 수행하여 특성을 MyProperty 가져옵니다.
개체의 PropertyDescriptorCollection 모든 속성을 사용하여 검색합니다.
가져올
MyProperty인 PropertyDescriptorCollection 덱싱.특성 변수에 이 속성의 특성을 저장합니다.
그런 다음 코드는 in AttributeCollection 의 BindableAttribute 값으로 설정하고 myAttribute 속성을 바인딩할 수 있는지 여부를 확인합니다.
이 코드 예제를 실행하려면 정규화된 어셈블리 이름을 제공해야 합니다. 정규화된 어셈블리 이름을 가져오는 방법에 대한 자세한 내용은
어셈블리 이름입니다.
// Gets the attributes for the property.
AttributeCollection^ attributes = TypeDescriptor::GetProperties( this )[ "MyProperty" ]->Attributes;
// Checks to see if the property is bindable.
BindableAttribute^ myAttribute = dynamic_cast<BindableAttribute^>(attributes[ BindableAttribute::typeid ]);
if ( myAttribute->Bindable )
{
// Insert code here.
}
// Gets the attributes for the property.
AttributeCollection attributes =
TypeDescriptor.GetProperties(this)["MyProperty"].Attributes;
// Checks to see if the property is bindable.
BindableAttribute myAttribute = (BindableAttribute)attributes[typeof(BindableAttribute)];
if (myAttribute.Bindable)
{
// Insert code here.
}
' Gets the attributes for the property.
Dim attributes As AttributeCollection = _
TypeDescriptor.GetProperties(Me)("MyProperty").Attributes
' Checks to see if the property is bindable.
Dim myAttribute As BindableAttribute = _
CType(attributes(System.Type.GetType("BindableAttribute")), BindableAttribute)
If (myAttribute.Bindable) Then
' Insert code here.
End If