Editor events

    Respond to accepted document changes, selection, mode transitions, file operations and authoring dialogs. Events let the host maintain save prompts and application state.

    HTML element notifications carry passive snapshots rather than a live COM DOM object.

    Actual Avalonia document after a visible edit, ready for application-owned save handling.
    Actual Avalonia document after a visible edit, ready for application-owned save handling.

    Use it in your application

    Use HtmlChanged for a host-owned dirty indicator and SelectionChanged for coalesced state refresh. File and mode events report acknowledged operations.

    Pasting is synchronous policy inspection. Do not start asynchronous mutation from that checkpoint and assume it ran before the paste.

    BrowserSessionRestored means the browser session was recreated and its previous undo history is unavailable. Keep the application document and save policy authoritative.

    editor.HtmlChanged += (_, _) => errorMessage.Text = "Document has unsaved changes.";
    editor.SelectionChanged += (_, _) => commandButton.IsEnabled = !editor.IsReadOnly;

    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
    BrowserSessionRestoredevent EventHandler BrowserSessionRestored
    ContextMenuShowingevent ContextMenuShowingEventHandler ContextMenuShowing
    DialogOpeningevent EventHandler<EditorDialogEventArgs> DialogOpening
    EditorModeChangedevent EventHandler<EditorModeChangedEventArgs> EditorModeChanged
    ErrorOccurredevent EventHandler<EditorErrorEventArgs> ErrorOccurred
    FileOpenedevent EventHandler<FileEventArgs> FileOpened
    FileSavedevent EventHandler<FileEventArgs> FileSaved
    HtmlChangedevent EventHandler HtmlChanged
    HtmlElementClickedevent EventHandler<HtmlElementClickedEventArgs> HtmlElementClicked
    HtmlElementMouseDownevent EventHandler<HtmlElementClickedEventArgs> HtmlElementMouseDown
    LicenseStatusChangedevent EventHandler LicenseStatusChanged
    LinkClickedevent EventHandler<LinkClickedEventArgs> LinkClicked
    Pastingevent EventHandler<PastingHtmlEventArgs> Pasting
    SelectionChangedevent EventHandler SelectionChanged
    SpellCheckCompletedevent EventHandler<SpellCheckCompletedEventArgs> SpellCheckCompleted

    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.