BindableAttribute BindableAttribute BindableAttribute BindableAttribute Class


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

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


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

If you're using C++/WinRT, then you need to add the BindableAttribute only if you're using the {Binding} markup extension. If you're using the {x:Bind} markup extension, then you don't need BindableAttribute (for more info, see XAML controls; bind to a C++/WinRT property).

// MyColors.idl
namespace MyColorsApp
    runtimeclass MyColors : Windows.UI.Xaml.Data.INotifyPropertyChanged
        Windows.UI.Xaml.Media.SolidColorBrush Brush1;
public ref class Employee sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
    // ...


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.


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

Initializes a new instance of the BindableAttribute class.

See also