New to Telerik UI for WinFormsStart a free 30-day trial

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

Definition

Namespace:Telerik.WinForms.Documents.FormatProviders.Xaml

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class XamlFormatProvider : DocumentFormatProviderBase, IConfigurableXamlFormatProvider, ITextBasedDocumentFormatProvider, IDocumentFormatProvider

Inheritance: objectDocumentFormatProviderBaseXamlFormatProvider

Implements: IConfigurableXamlFormatProviderIDocumentFormatProviderITextBasedDocumentFormatProvider

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

Constructors

Initializes a new instance of the XamlFormatProvider class.

C#
public XamlFormatProvider()

Properties

Gets a value indicating whether this instance can export.

C#
public override bool CanExport { get; }
Property Value:

true if this instance can export; otherwise, false.

Overrides: DocumentFormatProviderBase.CanExport

Implements: IDocumentFormatProvider.CanExport

Gets a value indicating whether this instance can import.

C#
public override bool CanImport { get; }
Property Value:

true if this instance can import; otherwise, false.

Overrides: DocumentFormatProviderBase.CanImport

Implements: IDocumentFormatProvider.CanImport

Gets or sets the settings used while exporting.

C#
public XamlExportSettings ExportSettings { get; set; }
Property Value:

The export settings.

Implements: IConfigurableXamlFormatProvider.ExportSettings

Gets or sets the settings used while importing.

C#
public XamlImportSettings ImportSettings { get; set; }
Property Value:

The import settings.

Implements: IConfigurableXamlFormatProvider.ImportSettings

Gets the name of the specific format provider.

C#
public override string Name { get; }
Property Value:

The name.

Overrides: DocumentFormatProviderBase.Name

Implements: IDocumentFormatProvider.Name

Gets the extensions supported by this format provider.

C#
public override IEnumerable<string> SupportedExtensions { get; }
Property Value:

The supported extensions.

Overrides: DocumentFormatProviderBase.SupportedExtensions

Implements: IDocumentFormatProvider.SupportedExtensions

Gets the version.

C#
public static string Version { get; }
Property Value:

The version.

Methods

Exports the specified RadDocument instance to XAML.

C#
public override void Export(RadDocument document, Stream output)
Parameters:documentRadDocument

The document.

outputStream

The Stream the document should be saved into.

Overrides: DocumentFormatProviderBase.Export(RadDocument, Stream)

Implements: IDocumentFormatProvider.Export(RadDocument, Stream)

Exports the specified document to a string.

C#
public string Export(RadDocument document)
Parameters:documentRadDocument

The document.

Returns:

string

A string containing the document.

Implements: ITextBasedDocumentFormatProvider.Export(RadDocument)

Imports the specified Stream into a RadDocument instance.

C#
public override RadDocument Import(Stream input)
Parameters:inputStream

The Stream containing the XAML document.

Returns:

RadDocument

The generated RadDocument instance.

Overrides: DocumentFormatProviderBase.Import(Stream)

Implements: IDocumentFormatProvider.Import(Stream)

Imports the specified XAML string.

C#
public RadDocument Import(string input)
Parameters:inputstring

The string containing the XAML document.

Returns:

RadDocument

The generated RadDocument instance.

Implements: ITextBasedDocumentFormatProvider.Import(string)

Loads a predefined stylesheet.

C#
public static Stylesheet LoadStylesheet(Stream input, XamlImportSettings settings = null)
Parameters:inputStream

The stream containing the stylesheet.

settingsXamlImportSettings

The XAML import settings.

Returns:

Stylesheet

The loaded object.

Saves a stylesheet.

C#
public static void SaveStylesheet(Stylesheet stylesheet, Stream output)
Parameters:stylesheetStylesheet

The stylesheet.

outputStream

The output stream.