Skip to main content

DocumentExportMode Enum

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents

Controls how documents are exported by serializers.

public enum DocumentExportMode

Inheritance: Enum -> DocumentExportMode

Remarks​

This enum replaces the former per-format SpacingExportMode and Preserve* boolean options with a single axis that determines both the control-word strategy and custom-marker behavior.

Fields​

NameDescription
InteropSafeNative, broadly interoperable controls understood by external editors. Custom ignorable markers are still emitted for properties that have no native representation, preserving round-trip fidelity for internal re-import.
PortableMaximum portability. Uses only native controls and omits all custom serializer markers. Suitable for export to external consumers that will never be re-imported. Some formatting may be lost.
RoundTripStrictMaximum internal round-trip fidelity. Emits synthetic controls (e.g., zero-width borders with \brsp spacing) and all custom ignorable markers ({\*\acdpad}, acd:* attributes). External editors may strip or misinterpret these controls.

InteropSafe Field​

Native, broadly interoperable controls understood by external editors. Custom ignorable markers are still emitted for properties that have no native representation, preserving round-trip fidelity for internal re-import.

public Avalonia.Controls.Documents.Serialization.DocumentExportMode InteropSafe

Portable Field​

Maximum portability. Uses only native controls and omits all custom serializer markers. Suitable for export to external consumers that will never be re-imported. Some formatting may be lost.

public Avalonia.Controls.Documents.Serialization.DocumentExportMode Portable

RoundTripStrict Field​

Maximum internal round-trip fidelity. Emits synthetic controls (e.g., zero-width borders with \brsp spacing) and all custom ignorable markers ({\*\acdpad}, acd:* attributes). External editors may strip or misinterpret these controls.

public Avalonia.Controls.Documents.Serialization.DocumentExportMode RoundTripStrict