Partager via


SyndicationItem.Content Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets and sets the content of the syndication item.

Namespace:  System.ServiceModel.Syndication
Assembly:  System.ServiceModel.Syndication (in System.ServiceModel.Syndication.dll)

Syntax

'Declaration
Public Property Content As SyndicationContent
public SyndicationContent Content { get; set; }

Property Value

Type: System.ServiceModel.Syndication.SyndicationContent
A SyndicationContent instance that contains the content of the syndication item.

Remarks

SyndicationContent is a base class for all syndication content types. The .NET Framework 3.5 defines the following syndication content types:

You can assign this property to any of these content types (or possibly a user-defined type derived from SyndicationContent).

For Atom 1.0, the Content property is serialized to a <content> element.

For RSS 2.0, the Content property is serialized to a <description> element for TextSyndicationContent, a <a10:content> element for UrlSyndicationContent and XmlSyndicationContent.

Examples

The following code shows how to add content to a SyndicationItem.

The following XML shows how the Content property is serialized for Atom 1.0.

TextSyndicationContent is serialized as shown in the following XML.

<content type="text">This is some content</content>

UrlSyndicationContent is serialized as shown in the following XML.

<content type="text/html" src="http://myurl/" />

XmlSyndicationContent is serialized as shown in the following XML.

<content type="MyXMLType">
    <mg:MyElement xmlns:mg="http://migree/elements">This is some text</mg:MyElement>
</content>

The following XML shows how the Content property is serialized for RSS 2.0.

TextSyndicationContent is serialized as shown in the following XML.

<description>This is some content</description>

UrlSyndicationContent is serialized as shown in the following XML.

<a10:content type="text/html" src="http://myurl/" />

XmlSyndicationContent is serialized as shown in the following XML.

<a10:content type="MyXMLType">
    <mg:MyElement xmlns:mg="http://migree/elements">This is some text</mg:MyElement>
</a10:content>

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.