Partager via


DataContractSerializer.KnownTypes Property

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

Gets a collection of types that may be present in the object graph serialized using this instance of the DataContractSerializer.

Namespace:  System.Runtime.Serialization
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

Syntax

'Declaration
Public ReadOnly Property KnownTypes As ReadOnlyCollection(Of Type)
public ReadOnlyCollection<Type> KnownTypes { get; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<Type>
A ReadOnlyCollection<T> that contains the expected types passed in as known types to the DataContractSerializer constructor.

Remarks

The KnownTypes property provides the set of known types that are used for serialization and deserialization.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

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