Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ContentPropertyAttribute Class
Definition
- Namespace:
- Microsoft.Maui.Controls
- Assembly:
- Microsoft.Maui.Controls.dll
- Source:
- ContentPropertyAttribute.cs
- Source:
- ContentPropertyAttribute.cs
- Source:
- ContentPropertyAttribute.cs
- Source:
- ContentPropertyAttribute.cs
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates the property used as the content property in 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
- Inheritance
-
ContentPropertyAttribute
- Attributes
Remarks
XAML processor uses to determine the content property.
Decorating types with ContentPropertyAttribute allows shorter XAML syntax. As
<ContentView>
<Label Text="Hello, Forms"/>
</ContentView>
This is equivalent to the following, more explicit XAML
<ContentView>
<ContentView.Content>
<Label Text="Hello, Forms"/>
</ContentView.Content>
</ContentView>
Constructors
| Name | Description |
|---|---|
| ContentPropertyAttribute(String) |
Creates a new ContentPropertyAttribute with the specified property name. |
Properties
| Name | Description |
|---|---|
| Name |
Gets the name of the content property. |
Applies to
Feedback
Was this page helpful?
