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

コンテンツ プロパティの名前を取得します

適用対象