BindableAttribute 클래스

정의

C++에 정의된 형식을 바인딩에 사용할 수 있도록 지정합니다.

public ref class BindableAttribute sealed : Attribute
[Windows.Foundation.Metadata.AttributeUsage(System.AttributeTargets.RuntimeClass)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
public sealed class BindableAttribute : Attribute
Public NotInheritable Class BindableAttribute
Inherits Attribute
상속
BindableAttribute
특성

예제

다음 코드 예제에서는이 특성에 대 한 일반적인 사용 패턴을 보여 줍니다. 전체 코드 목록은 XAML 데이터 바인딩 샘플을 참조하세요.

C++/WinRT를 사용하는 경우 {Binding} 태그 확장을 사용하는 경우에만 BindableAttribute를 추가해야 합니다. {x:Bind} 태그 확장을 사용하는 경우 BindableAttribute가 필요하지 않습니다(자세한 내용은 XAML 컨트롤 참조, C++/WinRT 속성에 바인딩).

// MyColors.idl
namespace MyColorsApp
{
    [bindable]
    [default_interface]
    runtimeclass MyColors : Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        MyColors();
        Windows.UI.Xaml.Media.SolidColorBrush Brush1;
    }
}
[Windows::UI::Xaml::Data::Bindable]
public ref class Employee sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
{
    // ...
}

설명

이 특성을 C++기반 데이터 클래스에 적용하여 바인딩 원본으로 사용할 수 있도록 합니다. C# 및 Microsoft Visual Basic에 정의된 모든 형식을 포함하여 CLR(공용 언어 런타임) 형식은 기본적으로 바인딩할 수 있습니다. ICustomPropertyProvider를 구현하여 형식을 바인딩할 수도 있습니다. 자세한 내용은 데이터 바인딩 심층 분석을 참조하세요.

생성자

BindableAttribute()

BindableAttribute 클래스의 새 instance 초기화합니다.

적용 대상

추가 정보