BindableAttribute BindableAttribute BindableAttribute Class

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

Syntax

Declaration

public sealed class BindableAttributepublic sealed class BindableAttributePublic NotInheritable Class BindableAttribute

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.

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
{
    // ...
}

Constructors summary

Initializes a new instance of the BindableAttribute class.

Constructors

  • BindableAttribute()
    BindableAttribute()
    BindableAttribute()
    BindableAttribute()

    Initializes a new instance of the BindableAttribute class.

    public BindableAttribute()public New()Public Sub New()public BindableAttribute()

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.AttributeUsageAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Data.dll