BindableAttribute BindableAttribute BindableAttribute BindableAttribute Class

Definition

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

public : sealed class BindableAttribute : Attribute
struct winrt::Windows::UI::Xaml::Data::BindableAttribute : Attribute
public sealed class BindableAttribute : Attribute
Public NotInheritable Class BindableAttribute Inherits Attribute
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

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

For an example of binding using C++/WinRT, see XAML controls; bind to a C++/WinRT property.

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

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 in depth.

Constructors

BindableAttribute() BindableAttribute() BindableAttribute() BindableAttribute()

Initializes a new instance of the BindableAttribute class.

See Also