BindableAttribute 构造函数

定义

初始化 BindableAttribute 类的新实例。

重载

名称 说明
BindableAttribute(Boolean)

使用布尔值初始化类的新实例 BindableAttribute

BindableAttribute(BindableSupport)

使用值之一BindableAttribute初始化类的新实例BindableSupport

BindableAttribute(Boolean, BindingDirection)

初始化 BindableAttribute 类的新实例。

BindableAttribute(BindableSupport, BindingDirection)

初始化 BindableAttribute 类的新实例。

BindableAttribute(Boolean)

Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs

使用布尔值初始化类的新实例 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

注解

将属性 BindableAttribute 标记为 “设置为 true” 时,此属性的值将设置为常量成员 Yes。 对于标记为 BindableAttribute 设置为 false的属性,值为 No。 因此,若要在代码中检查此属性的值,必须将属性指定为BindableAttribute.Yes或指定。BindableAttribute.No

另请参阅

适用于

BindableAttribute(BindableSupport)

Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs

使用值之一BindableAttribute初始化类的新实例BindableSupport

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

注解

将属性 BindableAttribute 标记为 “设置为 true” 时,此属性的值将设置为常量成员 Yes。 对于标记为 BindableAttribute 设置为 false的属性,值为 No。 因此,若要在代码中检查此属性的值,必须将属性指定为BindableAttribute.Yes或指定。BindableAttribute.No

另请参阅

适用于

BindableAttribute(Boolean, BindingDirection)

Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
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)

Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
BindableAttribute.cs
Source:
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 值。

适用于