The type '{0}' does not support direct content
This error occurs when you try to use object element syntax with a type which does not have a content property specified by the ContentPropertyAttribute. For more information, see XAML Syntax In Detail.
This error is raised when the file is a well-formed XAML document, but contains one or more type mismatches.
Error ID: XAML0502
Note
This error message also applies to the Silverlight Designer.
To correct this error
- Remove the object element assignment and use attribute syntax instead.
To correct this error
- If this error occurs for a custom type, consider applying the ContentPropertyAttribute to specify a content property.
Example
The following code example shows how to assign direct content to a Button control. The second declaration shows an attempt to assign direct content to an Ellipse object, which does not have a content property specified by the ContentPropertyAttribute. Uncomment the Ellipse declaration to raise error XAML0502.
<Button>OK</Button>
<!-- Uncomment the following line to raise error XAML0502. -->
<!-- <Ellipse>OK</Ellipse> -->