ContentPropertyAttribute Classe
Definição
Importante
Alguma informação relaciona-se com produtos pré-lançamento que podem ser substancialmente modificados antes de serem lançados. A Microsoft não oferece garantias, expressas ou implícitas, relativamente à informação aqui fornecida.
Indica a propriedade usada como propriedade de conteúdo em 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
- Herança
-
ContentPropertyAttribute
- Atributos
Observações
O processador XAML é usado para determinar a propriedade de conteúdo.
Decorar tipos com ContentPropertyAttribute permite uma sintaxe XAML mais curta. As
<ContentView>
<Label Text="Hello, Forms"/>
</ContentView>
Isto é equivalente ao seguinte, mais explícito, XAML
<ContentView>
<ContentView.Content>
<Label Text="Hello, Forms"/>
</ContentView.Content>
</ContentView>
Construtores
| Nome | Descrição |
|---|---|
| ContentPropertyAttribute(String) |
Cria um novo ContentPropertyAttribute com o nome de propriedade especificado. |
Propriedades
| Nome | Descrição |
|---|---|
| Name |
Obtém o nome da propriedade de conteúdo. |