XamlObjectReader Class

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Provides a XamlReader implementation that reads object graphs and generates a XAML node stream.

Namespace:   System.Xaml
Assembly:  System.Xaml (in System.Xaml.dll)


public class XamlObjectReader : XamlReader


Initializes a new instance of the XamlObjectReader class.

System_CAPS_pubmethodXamlObjectReader(Object, XamlObjectReaderSettings)

Initializes a new instance of the XamlObjectReader class with the specified reader settings.

System_CAPS_pubmethodXamlObjectReader(Object, XamlSchemaContext)

Initializes a new instance of the XamlObjectReader class with the specified schema context.

System_CAPS_pubmethodXamlObjectReader(Object, XamlSchemaContext, XamlObjectReaderSettings)

Initializes a new instance of the XamlObjectReader class with the specified schema context and reader settings.


Gets the object instance that is available at the current reader position.


Gets whether Dispose has been called.(Inherited from XamlReader.)


Gets a value that reports whether the reader position is at the end of the file.(Overrides XamlReader.IsEof.)


Gets the current XamlMember at the reader position, if the reader position is on a StartMember.(Overrides XamlReader.Member.)


Gets the XAML namespace declaration from the current reader position.(Overrides XamlReader.Namespace.)


Gets the type of the current node.(Overrides XamlReader.NodeType.)


Gets an object that provides schema information for the information set.(Overrides XamlReader.SchemaContext.)


Gets the XamlType of the object at the current reader position.(Overrides XamlReader.Type.)


Gets the value of the node at the current reader position.(Overrides XamlReader.Value.)


Closes the XAML node stream.(Inherited from XamlReader.)


Releases the unmanaged resources used by the XamlReader, and optionally, releases the managed resources. (Inherited from XamlReader.)


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Provides the next XAML node from the source object graph, if a node is available. (Overrides XamlReader.Read().)


Returns a XamlReader that is based on the current XamlReader, where the returned XamlReader is used to iterate through a subtree of the XAML node structure.(Inherited from XamlReader.)


Skips the current node and advances the reader position to the next node.(Inherited from XamlReader.)


Returns a string that represents the current object.(Inherited from Object.)


This API supports the product infrastructure and is not intended to be used directly from your code. Releases all resources used by the current instance of the XamlReader class.(Inherited from XamlReader.)

Use the XamlObjectReader in scenarios where you want to process an object graph, which is typically the object graph of an application that is originally generated from a XAML source. You might use the XamlObjectReaderwhere a round trip is made from a XAML start point to a XAML end point. Or you might run a XamlObjectReader over the object graph; process the intermediate XAML node stream, if it is required, by using APIs on XamlType and XamlMember; and then use XamlXmlWriter to serialize XAML nodes to XML.

More advanced scenarios might supply a XamlXmlWriter override and a specific XAML schema context that the XamlObjectReader uses and then passes to the writer override.

Typical scenarios for using XamlObjectReader call the members that XamlObjectReader implements; they also call Close, ReadSubtree, and Skip from the XamlReader base class.

.NET Framework
Available since 4.0

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top