ContentPropertyAttribute Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Označuje vlastnost použitou jako vlastnost obsahu v XAML.
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
- Dědičnost
-
ContentPropertyAttribute
- Atributy
Poznámky
Procesor XAML používá k určení vlastnosti obsahu.
Dekódování typů pomocí ContentPropertyAttribute umožňuje kratší syntaxi XAML. As
<ContentView>
<Label Text="Hello, Forms"/>
</ContentView>
To odpovídá následujícímu, explicitnějšímu xamlu.
<ContentView>
<ContentView.Content>
<Label Text="Hello, Forms"/>
</ContentView.Content>
</ContentView>
Konstruktory
| Name | Description |
|---|---|
| ContentPropertyAttribute(String) |
Vytvoří novou ContentPropertyAttribute se zadaným názvem vlastnosti. |
Vlastnosti
| Name | Description |
|---|---|
| Name |
Získá název vlastnosti obsahu. |