XamlServices.Transform Method

Definition

Connects a XamlReader and a XamlWriter in order to use a common XAML node set intermediary. Potentially transforms the content, depending on the types of readers and writers that are provided.

Overloads

Transform(XamlReader, XamlWriter)

Connects a XamlReader and a XamlWriter to use a common XAML node set intermediary. Potentially transforms the content, depending on the types of readers and writers that are provided.

Transform(XamlReader, XamlWriter, Boolean)

Connects a XamlReader and a XamlWriter to use a common XAML node set intermediary. Potentially transforms the content, depending on the types of readers and writers that are provided. Provides a parameter for specifying whether to close the writer after the call is completed.

Transform(XamlReader, XamlWriter)

Connects a XamlReader and a XamlWriter to use a common XAML node set intermediary. Potentially transforms the content, depending on the types of readers and writers that are provided.

C#
public static void Transform(System.Xaml.XamlReader xamlReader, System.Xaml.XamlWriter xamlWriter);

Parameters

xamlReader
XamlReader

The XamlReader implementation to use.

xamlWriter
XamlWriter

The XamlWriter to use.

Exceptions

xamlReader or xamlWriter input is null.

The XAML schema context does not match between the provided xamlReader and xamlWriter.

Remarks

This method is a wrapper around Transform(XamlReader, XamlWriter, Boolean), where closeWriter is specified as true.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Transform(XamlReader, XamlWriter, Boolean)

Connects a XamlReader and a XamlWriter to use a common XAML node set intermediary. Potentially transforms the content, depending on the types of readers and writers that are provided. Provides a parameter for specifying whether to close the writer after the call is completed.

C#
public static void Transform(System.Xaml.XamlReader xamlReader, System.Xaml.XamlWriter xamlWriter, bool closeWriter);

Parameters

xamlReader
XamlReader

The XamlReader implementation to use.

xamlWriter
XamlWriter

The XamlWriter to use.

closeWriter
Boolean

true to close the writer after the call is complete; false to leave the writer active at the last written position.

Exceptions

xamlReader or xamlWriter input is null.

The XAML schema context does not match between the provided xamlReader and xamlWriter.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10