BindableAttribute 建構函式

定義

初始化 BindableAttribute 類別的新執行個體。

多載

BindableAttribute(Boolean)

使用布林值 (Boolean),初始化 BindableAttribute 類別的新執行個體。

BindableAttribute(BindableSupport)

使用其中一個 BindableSupport值,初始化 BindableAttribute 類別的新執行個體。

BindableAttribute(Boolean, BindingDirection)

初始化 BindableAttribute 類別的新執行個體。

BindableAttribute(BindableSupport, BindingDirection)

初始化 BindableAttribute 類別的新執行個體。

BindableAttribute(Boolean)

來源:
BindableAttribute.cs
來源:
BindableAttribute.cs
來源:
BindableAttribute.cs

使用布林值 (Boolean),初始化 BindableAttribute 類別的新執行個體。

public:
 BindableAttribute(bool bindable);
public BindableAttribute (bool bindable);
new System.ComponentModel.BindableAttribute : bool -> System.ComponentModel.BindableAttribute
Public Sub New (bindable As Boolean)

參數

bindable
Boolean

true 表示使用繫結屬性,否則為 false

範例

下列程式代碼範例會適當地標記屬性以系結數據。 此程式代碼範例會建立新的 BindableAttribute、將其值設定為 BindableAttribute.Yes,並將它系結至 屬性。

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

備註

當您將 屬性標示 BindableAttributetrue時,這個屬性的值會設定為常數成員 Yes。 對於標示為 的屬性,BindableAttributefalse此值為 No。 因此,若要檢查程式代碼中這個屬性的值,您必須將 屬性指定為 BindableAttribute.YesBindableAttribute.No

另請參閱

適用於

BindableAttribute(BindableSupport)

來源:
BindableAttribute.cs
來源:
BindableAttribute.cs
來源:
BindableAttribute.cs

使用其中一個 BindableSupport值,初始化 BindableAttribute 類別的新執行個體。

public:
 BindableAttribute(System::ComponentModel::BindableSupport flags);
public BindableAttribute (System.ComponentModel.BindableSupport flags);
new System.ComponentModel.BindableAttribute : System.ComponentModel.BindableSupport -> System.ComponentModel.BindableAttribute
Public Sub New (flags As BindableSupport)

參數

flags
BindableSupport

其中一個 BindableSupport 值。

範例

下列程式代碼範例會適當地標記屬性以系結數據。 此程式代碼範例會建立新的 BindableAttribute、將其值設定為 BindableAttribute.Yes,並將它系結至 屬性。


   [Bindable(BindableSupport::Yes)]
   int get()
   {
      
      // Insert code here.
      return 0;
   }

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

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

備註

當您將 屬性標示 BindableAttributetrue時,這個屬性的值會設定為常數成員 Yes。 對於標示為 的屬性,BindableAttributefalse此值為 No。 因此,若要檢查程式代碼中這個屬性的值,您必須將 屬性指定為 BindableAttribute.YesBindableAttribute.No

另請參閱

適用於

BindableAttribute(Boolean, BindingDirection)

來源:
BindableAttribute.cs
來源:
BindableAttribute.cs
來源:
BindableAttribute.cs

初始化 BindableAttribute 類別的新執行個體。

public:
 BindableAttribute(bool bindable, System::ComponentModel::BindingDirection direction);
public BindableAttribute (bool bindable, System.ComponentModel.BindingDirection direction);
new System.ComponentModel.BindableAttribute : bool * System.ComponentModel.BindingDirection -> System.ComponentModel.BindableAttribute
Public Sub New (bindable As Boolean, direction As BindingDirection)

參數

bindable
Boolean

true 表示使用繫結屬性,否則為 false

direction
BindingDirection

其中一個 BindingDirection 值。

適用於

BindableAttribute(BindableSupport, BindingDirection)

來源:
BindableAttribute.cs
來源:
BindableAttribute.cs
來源:
BindableAttribute.cs

初始化 BindableAttribute 類別的新執行個體。

public:
 BindableAttribute(System::ComponentModel::BindableSupport flags, System::ComponentModel::BindingDirection direction);
public BindableAttribute (System.ComponentModel.BindableSupport flags, System.ComponentModel.BindingDirection direction);
new System.ComponentModel.BindableAttribute : System.ComponentModel.BindableSupport * System.ComponentModel.BindingDirection -> System.ComponentModel.BindableAttribute
Public Sub New (flags As BindableSupport, direction As BindingDirection)

參數

flags
BindableSupport

其中一個 BindableSupport 值。

direction
BindingDirection

其中一個 BindingDirection 值。

適用於