Op Englesch liesen Editéieren

Deelen iwwer


BindableAttribute Constructors

Definition

Initializes a new instance of the BindableAttribute class.

Overloads

BindableAttribute(Boolean)

Initializes a new instance of the BindableAttribute class with a Boolean value.

BindableAttribute(BindableSupport)

Initializes a new instance of the BindableAttribute class with one of the BindableSupport values.

BindableAttribute(Boolean, BindingDirection)

Initializes a new instance of the BindableAttribute class.

BindableAttribute(BindableSupport, BindingDirection)

Initializes a new instance of the BindableAttribute class.

BindableAttribute(Boolean)

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

Initializes a new instance of the BindableAttribute class with a Boolean value.

C#
public BindableAttribute(bool bindable);

Parameters

bindable
Boolean

true to use property for binding; otherwise, false.

Examples

The following code example marks a property as appropriate to bind data to. This code example creates a new BindableAttribute, sets its value to BindableAttribute.Yes, and binds it to the property.

C#
[Bindable(true)]
 public int MyProperty {
    get {
       // Insert code here.
       return 0;
    }
    set {
       // Insert code here.
    }
 }

Remarks

When you mark a property with the BindableAttribute set to true, the value of this attribute is set to the constant member Yes. For a property marked with the BindableAttribute set to false, the value is No. Therefore, to check the value of this attribute in your code, you must specify the attribute as BindableAttribute.Yes or BindableAttribute.No.

See also

Applies to

.NET 10 an aner Versiounen
Produkt Versiounen
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

BindableAttribute(BindableSupport)

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

Initializes a new instance of the BindableAttribute class with one of the BindableSupport values.

C#
public BindableAttribute(System.ComponentModel.BindableSupport flags);

Parameters

flags
BindableSupport

One of the BindableSupport values.

Examples

The following code example marks a property as appropriate to bind data to. This code example creates a new BindableAttribute, sets its value to BindableAttribute.Yes, and binds it to the property.

C#
[Bindable(BindableSupport.Yes)]
 public int MyProperty {
    get {
       // Insert code here.
       return 0;
    }
    set {
       // Insert code here.
    }
 }

Remarks

When you mark a property with the BindableAttribute set to true, the value of this attribute is set to the constant member Yes. For a property marked with the BindableAttribute set to false, the value is No. Therefore, to check the value of this attribute in your code, you must specify the attribute as BindableAttribute.Yes or BindableAttribute.No.

See also

Applies to

.NET 10 an aner Versiounen
Produkt Versiounen
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

BindableAttribute(Boolean, BindingDirection)

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

Initializes a new instance of the BindableAttribute class.

C#
public BindableAttribute(bool bindable, System.ComponentModel.BindingDirection direction);

Parameters

bindable
Boolean

true to use property for binding; otherwise, false.

direction
BindingDirection

One of the BindingDirection values.

Applies to

.NET 10 an aner Versiounen
Produkt Versiounen
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

BindableAttribute(BindableSupport, BindingDirection)

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

Initializes a new instance of the BindableAttribute class.

C#
public BindableAttribute(System.ComponentModel.BindableSupport flags, System.ComponentModel.BindingDirection direction);

Parameters

flags
BindableSupport

One of the BindableSupport values.

direction
BindingDirection

One of the BindingDirection values.

Applies to

.NET 10 an aner Versiounen
Produkt Versiounen
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1