Windows Dev Center

BindableAttribute attribute

Specifies that a type defined in C++ can be used for binding.

Inheritance

Object
  Attribute
    BindableAttribute

Syntax


public sealed class BindableAttribute : Attribute

Members

The BindableAttribute attribute has these types of members:

Constructors

The BindableAttribute attribute has these constructors.

ConstructorDescription
BindableAttribute Initializes a new instance of the BindableAttribute class.

 

Methods

The BindableAttribute attribute inherits methods from the Object class.

Remarks

Apply this attribute to C++-based data classes to enable their use as binding sources. Common language runtime (CLR) types, including all types defined in C# and Microsoft Visual Basic, are bindable by default. You can also make a type bindable by implementing ICustomPropertyProvider. For more info, see Data binding overview.

Examples

The following code example shows the typical usage pattern for this attribute. For the complete code listing, see the XAML data binding sample.


[Windows::UI::Xaml::Data::Bindable]
public ref class Employee sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
{
    // ...
}

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Data
Windows::UI::Xaml::Data [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Data
Windows::UI::Xaml::Data [C++]

Metadata

Windows.winmd

Attributes

[AttributeUsage(512)]
[Version(0x6020000)]

See also

Object
Attribute
Binding
ICustomPropertyProvider
XAML data binding sample
Data binding overview

 

 

Show:
© 2015 Microsoft