Class
XamlFormatProvider

Represents a format provider that can import and export XAML documents from a RadDocument.

Definition

Namespace:Telerik.Windows.Documents.FormatProviders.Xaml

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class XamlFormatProvider : DocumentFormatProviderBase, IConfigurableXamlFormatProvider, ITextBasedDocumentFormatProvider, IDocumentFormatProvider

Inheritance: objectDocumentFormatProviderBaseXamlFormatProvider

Implements: IConfigurableXamlFormatProviderIDocumentFormatProviderITextBasedDocumentFormatProvider

Inherited Members DocumentFormatProviderBase.Import(byte[])DocumentFormatProviderBase.FilesDescription

Constructors

XamlFormatProvider()

Initializes a new instance of the XamlFormatProvider class.

Declaration

cs-api-definition
public XamlFormatProvider()

Properties

CanExport

Gets a value indicating whether this instance can export.

Declaration

cs-api-definition
public override bool CanExport { get; }

Property Value

bool

true if this instance can export; otherwise, false.

Overrides DocumentFormatProviderBase.CanExport

Implements IDocumentFormatProvider.CanExport

CanImport

Gets a value indicating whether this instance can import.

Declaration

cs-api-definition
public override bool CanImport { get; }

Property Value

bool

true if this instance can import; otherwise, false.

Overrides DocumentFormatProviderBase.CanImport

Implements IDocumentFormatProvider.CanImport

ExportSettings

Gets or sets the settings used while exporting.

Declaration

cs-api-definition
public XamlExportSettings ExportSettings { get; set; }

Property Value

XamlExportSettings

The export settings.

Implements IConfigurableXamlFormatProvider.ExportSettings

ImportSettings

Gets or sets the settings used while importing.

Declaration

cs-api-definition
public XamlImportSettings ImportSettings { get; set; }

Property Value

XamlImportSettings

The import settings.

Implements IConfigurableXamlFormatProvider.ImportSettings

Name

Gets the name of the specific format provider.

Declaration

cs-api-definition
public override string Name { get; }

Property Value

string

The name.

Overrides DocumentFormatProviderBase.Name

Implements IDocumentFormatProvider.Name

SupportedExtensions

Gets the extensions supported by this format provider.

Declaration

cs-api-definition
public override IEnumerable<string> SupportedExtensions { get; }

Property Value

IEnumerable<string>

The supported extensions.

Overrides DocumentFormatProviderBase.SupportedExtensions

Implements IDocumentFormatProvider.SupportedExtensions

Version

Gets the version.

Declaration

cs-api-definition
public static string Version { get; }

Property Value

string

The version.

Methods

Export(RadDocument)

Exports the specified document to a string.

Declaration

cs-api-definition
public string Export(RadDocument document)

Parameters

document

RadDocument

The document.

Returns

string

A string containing the document.

Implements ITextBasedDocumentFormatProvider.Export(RadDocument)

Export(RadDocument, Stream)

Exports the specified RadDocument instance to XAML.

Declaration

cs-api-definition
public override void Export(RadDocument document, Stream output)

Parameters

document

RadDocument

The document.

output

Stream

The Stream the document should be saved into.

Overrides DocumentFormatProviderBase.Export(RadDocument, Stream)

Implements IDocumentFormatProvider.Export(RadDocument, Stream)

Import(Stream)

Imports the specified Stream into a RadDocument instance.

Declaration

cs-api-definition
public override RadDocument Import(Stream input)

Parameters

input

Stream

The Stream containing the XAML document.

Returns

RadDocument

The generated RadDocument instance.

Overrides DocumentFormatProviderBase.Import(Stream)

Implements IDocumentFormatProvider.Import(Stream)

Import(string)

Imports the specified XAML string.

Declaration

cs-api-definition
public RadDocument Import(string input)

Parameters

input

string

The string containing the XAML document.

Returns

RadDocument

The generated RadDocument instance.

Implements ITextBasedDocumentFormatProvider.Import(string)

LoadStylesheet(Stream, XamlImportSettings)

Loads a predefined stylesheet.

Declaration

cs-api-definition
public static Stylesheet LoadStylesheet(Stream input, XamlImportSettings settings = null)

Parameters

input

Stream

The stream containing the stylesheet.

settings

XamlImportSettings

Returns

Stylesheet

The loaded object.

SaveStylesheet(Stylesheet, Stream)

Saves a stylesheet.

Declaration

cs-api-definition
public static void SaveStylesheet(Stylesheet stylesheet, Stream output)

Parameters

stylesheet

Stylesheet

The stylesheet.

output

Stream

The output stream.