Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BindableAttribute Constructor (Boolean)

 

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

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public:
BindableAttribute(
	bool bindable
)

Parameters

bindable
Type: System::Boolean

true to use property for binding; otherwise, false.

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.

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.

public:
   [property:Bindable(true)]
   property int MyProperty 
   {
      int get()
      {
         // Insert code here.
         return 0;
      }
      void set( int theValue )
      {
         // Insert code here.
      }
   }

.NET Framework
Available since 1.1
Silverlight
Available since 4.0
Return to top
Show:
© 2017 Microsoft