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
)

Parameters

stream
Type: System.IO.Stream

The destination stream.

instance
Type: System.Object

The root of the object graph to process.

ExceptionCondition
ArgumentNullException

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
Show:
© 2015 Microsoft