Content service

    Load, inspect, transform and export HTML through the awaited Content facade. Use it when your application owns document persistence, imports or generated messages.

    The facade is available as editor.Content; its interface can be replaced by an application implementation.

    Actual Avalonia editor showing the document and native authoring controls.
    Actual Avalonia editor showing the document and native authoring controls.

    Use it in your application

    The editor must be attached to a visible window before readiness can complete. Fresh exports apply a pending Source draft or report an apply failure; they do not silently return an older rendered document.

    All examples assume an editor named editor, already attached to a visible window, and an awaited editor.Ready. Keep operations asynchronous instead of blocking the UI thread.

    string body = await editor.Content.GetBodyHtmlAsync();
    string document = await editor.Content.GetDocumentHtmlAsync();

    Members

    These signatures come from the delivered 1.0.2 assemblies and XML documentation. Cancellation tokens can be supplied to awaited operations. Follow the source-specific notes above when adapting a WPF integration.

    MemberSignature
    ChangeElementIdAsyncTask<EditorSnapshot> ChangeElementIdAsync(string oldId, string newId, CancellationToken cancellationToken)
    ClearContentAsyncTask<EditorSnapshot> ClearContentAsync(CancellationToken cancellationToken)
    ElementExistsAsyncTask<bool> ElementExistsAsync(string elementId, CancellationToken cancellationToken)
    EmbedLocalImagesAsBase64AsyncTask EmbedLocalImagesAsBase64Async(CancellationToken cancellationToken)
    GetAllImageSourcesAsyncTask<string[]> GetAllImageSourcesAsync(CancellationToken cancellationToken)
    GetAllLinkHrefsAsyncTask<string[]> GetAllLinkHrefsAsync(CancellationToken cancellationToken)
    GetAttributeValueOfAnElementAsyncTask<string> GetAttributeValueOfAnElementAsync(string elementId, string attributeName, CancellationToken cancellationToken)
    GetBodyClassNameAsyncTask<string> GetBodyClassNameAsync(CancellationToken cancellationToken)
    GetBodyHtmlAsyncTask<string> GetBodyHtmlAsync(CancellationToken cancellationToken)
    GetBodyHtmlAsyncTask<string> GetBodyHtmlAsync(bool getInXhtml, CancellationToken cancellationToken)
    GetBodyStyleAsyncTask<string> GetBodyStyleAsync(CancellationToken cancellationToken)
    GetBodyTextAsyncTask<string> GetBodyTextAsync(CancellationToken cancellationToken)
    GetDocumentHtmlAsyncTask<string> GetDocumentHtmlAsync(CancellationToken cancellationToken)
    GetDocumentHtmlAsyncTask<string> GetDocumentHtmlAsync(bool getInXhtml, CancellationToken cancellationToken)
    GetDocumentXmlAsyncTask<string> GetDocumentXmlAsync(CancellationToken cancellationToken)
    GetEmailMessageWithLocalImagesEmbeddedAsyncTask<MailMessage> GetEmailMessageWithLocalImagesEmbeddedAsync(CancellationToken cancellationToken)
    GetFormattedPlainTextAsyncTask<string> GetFormattedPlainTextAsync(CancellationToken cancellationToken)
    GetInnerHtmlOfAnElementAsyncTask<string> GetInnerHtmlOfAnElementAsync(string elementId, CancellationToken cancellationToken)
    GetOuterHtmlOfAnElementAsyncTask<string> GetOuterHtmlOfAnElementAsync(string elementId, CancellationToken cancellationToken)
    InsertHeadElementAsyncTask<EditorSnapshot> InsertHeadElementAsync(string tagName, string html, CancellationToken cancellationToken)
    InsertHorizontalRuleAsyncTask InsertHorizontalRuleAsync(CancellationToken cancellationToken)
    InsertHtmlAsyncTask InsertHtmlAsync(string html, bool keepSelected, CancellationToken cancellationToken)
    InsertTextAsyncTask InsertTextAsync(string text, CancellationToken cancellationToken)
    ReapplyDefaultBodyStyleAsyncTask ReapplyDefaultBodyStyleAsync(CancellationToken cancellationToken)
    RemoveHtmlElementByIdAsyncTask<EditorSnapshot> RemoveHtmlElementByIdAsync(string id, CancellationToken cancellationToken)
    RemoveHtmlElementFromHeadByTagAsyncTask<EditorSnapshot> RemoveHtmlElementFromHeadByTagAsync(string tagName, CancellationToken cancellationToken)
    SetAttributeValueOfAnElementAsyncTask<EditorSnapshot> SetAttributeValueOfAnElementAsync(string elementId, string attributeName, string value, CancellationToken cancellationToken)
    SetBodyClassNameAsyncTask<EditorSnapshot> SetBodyClassNameAsync(string className, CancellationToken cancellationToken)
    SetBodyHtmlAsyncTask<EditorSnapshot> SetBodyHtmlAsync(string html, CancellationToken cancellationToken)
    SetBodyStyleAsyncTask<EditorSnapshot> SetBodyStyleAsync(string styleValue, CancellationToken cancellationToken)
    SetBodyTextAsyncTask<EditorSnapshot> SetBodyTextAsync(string text, CancellationToken cancellationToken)
    SetDefaultBodyFontFamilyAsyncTask SetDefaultBodyFontFamilyAsync(string fontFamily, CancellationToken cancellationToken)
    SetDefaultBodyFontSizeAsyncTask SetDefaultBodyFontSizeAsync(string cssFontSize, CancellationToken cancellationToken)
    SetDefaultBodyForeColorAsyncTask SetDefaultBodyForeColorAsync(string cssColor, CancellationToken cancellationToken)
    SetDocumentHtmlAsyncTask<EditorSnapshot> SetDocumentHtmlAsync(string html, CancellationToken cancellationToken)
    UpdateInnerHtmlOfAnElementAsyncTask<EditorSnapshot> UpdateInnerHtmlOfAnElementAsync(string elementId, string newHtml, CancellationToken cancellationToken)
    MailMergeMailMergeService MailMerge { get; }
    TableAuthoringServiceTableAuthoringService TableAuthoringService { get; }

    Continue with

    Last updated on Oct 18, 2026

    Put this into practice.

    Start with the C# Avalonia sample. Restore this edition's package and install the native browser prerequisites before running it.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.