ContentPropertyAttribute 클래스

정의

(기본값) 콘텐츠 속성인 형식의 속성을 나타냅니다.

[System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)]
public sealed class ContentPropertyAttribute : Attribute
type ContentPropertyAttribute = class
    inherit Attribute
상속
ContentPropertyAttribute
특성

설명

XAML 프로세서는 를 사용하여 콘텐츠 속성을 확인합니다.

ContentPropertyAttribute를 사용하여 형식을 데코레이팅하면 XAML 구문을 더 짧게 사용할 수 있습니다. As

ContentViewContentProperty 특성이 적용 되었으므로이 XAML은 유효 합니다.
<ContentView>
<Label Text="Hello, Forms"/>
</ContentView>

이는 보다 명시적인 다음 XAML과 동일합니다.

<ContentView>
<ContentView.Content>
<Label Text="Hello, Forms"/>
</ContentView.Content>
</ContentView>

생성자

ContentPropertyAttribute(String)

ContentPropertyAttribute 클래스의 새 인스턴스를 초기화합니다.

속성

Name

콘텐츠 속성의 이름을 가져옵니다.

적용 대상