次の方法で共有


BindableAttribute コンストラクタ (BindableSupport)

BindableSupport 値の 1 つを指定して、BindableAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)

構文

'宣言
Public Sub New ( _
    flags As BindableSupport _
)
'使用
Dim flags As BindableSupport

Dim instance As New BindableAttribute(flags)
public BindableAttribute (
    BindableSupport flags
)
public:
BindableAttribute (
    BindableSupport flags
)
public BindableAttribute (
    BindableSupport flags
)
public function BindableAttribute (
    flags : BindableSupport
)

パラメータ

解説

BindableAttributetrue を設定してプロパティをマークすると、この属性の値は定数メンバ Yes に設定されます。false に設定された BindableAttribute でマークしたプロパティの場合、値は No になります。したがって、コード内でこの属性の値を確認する場合は、この属性を BindableAttribute.Yes または BindableAttribute.No として指定する必要があります。

使用例

プロパティがデータのバインド先として適切であることをマークするコード例を次に示します。このコード例では、新しい BindableAttribute を作成し、その値を BindableAttribute.Yes に設定してから、その属性をプロパティに関連付けます。

<Bindable(BindableSupport.Yes)> _
Public Property MyProperty As Integer
   Get
      ' Insert code here.
      Return 0
   End Get
   Set
      ' Insert code here.
   End Set
End Property
  
[Bindable(BindableSupport.Yes)]
 public int MyProperty {
    get {
       // Insert code here.
       return 0;
    }
    set {
       // Insert code here.
    }
 }
   
   [Bindable(BindableSupport::Yes)]
   int get()
   {
      
      // Insert code here.
      return 0;
   }

   void set( int theValue )
   {
      
      // Insert code here.
   }

}
/** @attribute Bindable(BindableSupport.Yes)
 */
/** @property 
 */
public int get_MyProperty()
{
    // Insert code here.
    return 0;
} //get_MyProperty

/** @property 
 */
public void set_MyProperty(int value)
{
    // Insert code here.
} //set_MyProperty

プラットフォーム

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

BindableAttribute クラス
BindableAttribute メンバ
System.ComponentModel 名前空間
BindableAttribute クラス
BindableSupport