Export (0) Print
Expand All

XamlServices.Save Method (Stream, Object)

Processes a provided object graph into a XAML node representation and then into an output stream for serialization.

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

public static void Save(
	Stream stream,
	Object instance


Type: System.IO.Stream

The destination stream.

Type: System.Object

The root of the object graph to process.


stream input is null.

Important noteImportant

XamlServices is not the recommended XAML reading or XAML writing API set if you are processing Windows Presentation Foundation (WPF) types, or types based on WPF. For WPF usage, use System.Windows.Markup.XamlReader for reading or loading XAML; and System.Windows.Markup.XamlWriter for writing back XAML. These classes use System.Xaml APIs internally in their implementation; however, they also provide support for WPF-specific concepts that influence the nature of XAML reading and writing, such as optimizations for dependency properties.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
© 2015 Microsoft