XamlBinaryWriter XamlBinaryWriter XamlBinaryWriter Class

Definition

Produces a pre-parsed binary representation of a XAML production.

public : sealed class XamlBinaryWriter : IXamlBinaryWriter
public sealed class XamlBinaryWriter : IXamlBinaryWriter
Public NotInheritable Class XamlBinaryWriter Implements IXamlBinaryWriter
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The binary representation of XAML uses an XBF file extension. The binary representation enables performance advantages versus loading and parsing a XAML file as text. Loading the binary representation is most useful when loading XAML files that define large resources, such as the generic.xaml files that define templates.

XamlBinaryWriter is not intended for use by typical app code. It is intended for use by tools and processes that are directly involved in producing an app package on a developer's machine.

The XBF format is intended to be write-once. Anyone compiling into the XBF format should always maintain that same XAML in its text representation, so that tools or processes can edit the XAML, and so that the source XAML remains human-readable.

Methods

Write(IVector, IVector, IXamlMetadataProvider) Write(IVector, IVector, IXamlMetadataProvider) Write(IVector, IVector, IXamlMetadataProvider)

Produces a binary representation of XAML. Input streams are produced in text representation, and output streams are populated with XAML in binary (XBF) representation.

Important

XamlBinaryWriter is not intended for use by typical app code. It is intended for use by tools and processes that are directly involved in producing an app package on a developer's machine.

public : static XamlBinaryWriterErrorInformation Write(IVector<IRandomAccessStream> inputStreams, IVector<IRandomAccessStream> outputStreams, IXamlMetadataProvider xamlMetadataProvider)
public static XamlBinaryWriterErrorInformation Write(IList<IRandomAccessStream> inputStreams, IList<IRandomAccessStream> outputStreams, IXamlMetadataProvider xamlMetadataProvider)
Public Static Function Write(inputStreams As IList<IRandomAccessStream>, outputStreams As IList<IRandomAccessStream>, xamlMetadataProvider As IXamlMetadataProvider) As XamlBinaryWriterErrorInformation
Parameters
inputStreams
IVector<IRandomAccessStream> IList<IRandomAccessStream> IList<IRandomAccessStream>

The set of input streams. These are expected to access the text representation of the XAML to write into XBF format.

outputStreams
IVector<IRandomAccessStream> IList<IRandomAccessStream> IList<IRandomAccessStream>

The set of output streams. When the method returns each output stream provides access to the XBF binary representation. You'd typically use this stream to create a file.

xamlMetadataProvider
IXamlMetadataProvider IXamlMetadataProvider IXamlMetadataProvider

A helper object that maps types for XAML productions.

Returns

A structure that captures any error information that is reported by the conversion into XBF format.

Remarks

Any input stream that generated error information is skipped and won't write anything into the corresponding output stream.