ContentPropertyAttribute Sınıf

Tanım

XAML'de içerik özelliği olarak kullanılan özelliği gösterir.

public ref class ContentPropertyAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public sealed class ContentPropertyAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)>]
type ContentPropertyAttribute = class
    inherit Attribute
Public NotInheritable Class ContentPropertyAttribute
Inherits Attribute
Devralma
ContentPropertyAttribute
Öznitelikler

Açıklamalar

XAML işlemcisi, içerik özelliğini belirlemek için kullanır.

ContentPropertyAttribute ile türlerin dekorasyonu daha kısa XAML söz dizimine olanak tanır. As

ContentView ContentProperty özniteliği uygulanmışsa, bu XAML geçerlidir:
<ContentView>
<Label Text="Hello, Forms"/>
</ContentView>

Bu, aşağıdaki daha açık XAML ile eşdeğerdir

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

Oluşturucular

Name Description
ContentPropertyAttribute(String)

Belirtilen özellik adıyla yeni ContentPropertyAttribute bir oluşturur.

Özellikler

Name Description
Name

İçerik özelliğinin adını alır.

Şunlara uygulanır