BindableAttribute.Bindable プロパティ
アセンブリ: System (system.dll 内)


MyProperty にバインドできるかどうかを確認するコード例を次に示します。最初に、次を実行することによって、MyProperty の属性を取得します。
次に、myAttribute を AttributeCollection にある BindableAttribute の値に設定し、プロパティがバインドできるかどうかを確認します。
このコード例を実行するには、アセンブリの完全修飾名を指定する必要があります。アセンブリの完全修飾名を取得する方法については、
' 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
// 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. 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).get_Item("MyProperty"). get_Attributes(); // Checks to see if the property is bindable. // You must supply a valid fully qualified assembly name here. BindableAttribute myAttribute = (BindableAttribute)(attributes.get_Item(Type.GetType ("Assembly text name, Version, Culture, PublicKeyToken"))); if (myAttribute.get_Bindable()) { // Insert code here. }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- BindableAttribute.Bindable プロパティのページへのリンク