BindableAttribute.Bindable 속성

정의

일반적으로 바인딩에 속성이 사용됨을 나타내는 값을 가져옵니다.

public:
 property bool Bindable { bool get(); };
public bool Bindable { get; }
member this.Bindable : bool
Public ReadOnly Property Bindable As Boolean

속성 값

일반적으로 바인딩에 속성이 사용되면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 가 바인딩 가능한지 여부를 MyProperty 확인합니다. 먼저 코드는 다음을 수행하여 에 대한 MyProperty 특성을 가져옵니다.

그런 다음 코드는 의 값을 BindableAttributeAttributeCollection 로 설정하고 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

적용 대상

추가 정보