Export (0) Print
Expand All

XamlWriter Class

Provides a single static Save method (multiple overloads) that can be used for limited XAML serialization of provided run-time objects into XAML markup.

System::Object
  System.Windows.Markup::XamlWriter

Namespace:  System.Windows.Markup
Assembly:  PresentationFramework (in PresentationFramework.dll)

public ref class XamlWriter abstract sealed

  NameDescription
Public methodStatic memberSave(Object)Returns a XAML string that serializes the specified object and its properties.
Public methodStatic memberSave(Object, Stream)Saves XAML information into a specified stream to serialize the specified object and its properties.
Public methodStatic memberSave(Object, TextWriter)Saves XAML information as the source for a provided TextWriter object. The output of the TextWriter can then be used to serialize the provided object and its properties.
Public methodStatic memberSave(Object, XamlDesignerSerializationManager)Saves XAML information into a custom serializer. The output of the serializer can then be used to serialize the provided object and its properties.
Public methodStatic memberSave(Object, XmlWriter)Saves XAML information as the source for a provided XmlWriter object. The output of the XmlWriter can then be used to serialize the provided object and its properties.
Top

The serialization enabled by this method has a series of limitations. This is because the serialization enabled is explicitly run-time, and does not have access to possible design-time information in the original XAML (if any). For details, see Serialization Limitations of XamlWriter.Save.

Calling Save is not permitted when running in partial trust. This includes from XBAPs.

The following example serializes a Button into a string using the XamlWriter class. The string is then deserialized back into a Button using the static Load method on the XamlReader class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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

Community Additions

ADD
Show:
© 2014 Microsoft