A native-XAML HTML editor for WPF apps - one NuGet install, clean XHTML, Word paste that survives, source code if you need it. In production since 2015, ready for .NET 10.

Download Samples
C# & VB.NET sample projects14-day evaluation
Package Manager Console
PM> Install-Package SpiceLogic.HtmlEditor.WPF

Meet the WPF HTML Editor

Place the control on a XAML window and you get a working WPF HTML editor: toolbar, WYSIWYG surface, formatted source view, preview mode, context menus, WPF dialogs, spell checking, table editing, and image insertion.

This is not a WinForms editor passed through WindowsFormsHost and called WPF. The editor is built for WPF integration around the editing surface: XAML toolbar, XAML vector icons, ResourceDictionary theming, bindable HTML properties, and the WPF customization points a serious desktop team expects.

The 3.x line makes the product feel current again: crisp toolbar icons at modern DPI, readable source view, NuGet delivery, license-key activation, and .NET 10 support for maintained WPF applications.

WPF window showing the HTML editor with toolbar, editing surface, source view, and preview mode

Install in One Line with NuGet

Add the editor to your WPF project from NuGet:

PM> Install-Package SpiceLogic.HtmlEditor.WPF

Then drop it into a XAML window:

xmlns:editor="clr-namespace:SpiceLogic.HtmlEditor.WPF;assembly=SpiceLogic.HtmlEditor.WPF"
...
<editor:WpfHtmlEditor BodyHtml="..." HtmlChanged="OnHtmlChanged" />

The current line supports .NET Framework 4.5, 4.7.2, 4.8, and .NET 5 through .NET 10 on Windows. That keeps it useful for maintained legacy WPF systems and current Windows desktop projects.

License-key activation replaces the older unlocked-DLL workflow. Set WpfHtmlEditor.LicenseKey once at startup and move on to evaluating the editor, not the licensing plumbing.

Visual Studio showing the NuGet command and a WpfHtmlEditor element in XAML

Modern XAML Vector Icons at Any DPI

WPF buyers notice when a third-party toolbar looks blurry beside the rest of the application. Every toolbar button in the 3.x line is a XAML vector path, not a PNG asset.

The icon set stays crisp at 100%, 125%, 150%, 175%, and 200% DPI, and on 4K monitors and per-monitor DPI configurations. That matters when your app runs on developer workstations, finance desktops, industrial terminals, and modern laptops with mixed scaling.

This is one of the practical differences between a WPF-focused control and a control merely hosted inside a WPF window. The toolbar can live visually inside your WPF application instead of looking like an older desktop component pasted on top.

Crisp XAML vector toolbar icons in the WPF HTML editor at high DPI

Switch Between WYSIWYG, Source, and Preview Modes

Use WYSIWYG mode when users want to compose visually. Switch to Source mode when a developer or power user needs to inspect or edit the generated HTML. Use Preview mode when content should be rendered read-only before saving, printing, or sending.

The Source view is formatted and indented in 3.x, not a single unwrapped line of markup. Right-click anywhere in WYSIWYG and select View Source to inspect the markup behind a selection without leaving the document.

In Preview mode, Ctrl-clicking a hyperlink opens it in the user's actual default browser. That keeps preview behavior aligned with the user's desktop environment while the editor remains embedded inside your WPF screen.

WPF HTML editor showing WYSIWYG content, formatted source view, and preview mode

Clean HTML Output, Fragment or Full Document

Some WPF screens only need an HTML fragment saved into a database column. Other workflows need a complete document for email, export, preview, or integration with another system. The editor exposes both shapes without forcing you to scrape the document yourself.

  • BodyHtml, the inner HTML of the document body, useful when you store content inside your own page, template, or database column.
  • DocumentHtml, the full HTML document including wrapper, header, and DOCTYPE, useful when you save or send standalone HTML.

HTML5 is the default document type in 3.x, with override controls available for older render targets. That gives your WPF app a predictable output contract for templates, emails, CRM notes, and ERP letters.

Code showing BodyHtml and DocumentHtml output from the WPF HTML editor

Paste From Word and Outlook Without the Mess

End users paste from Word and Outlook every day. If the editor does not handle that well, your database fills with Office clipboard noise and your support team eventually owns the problem.

The editor auto-detects Microsoft Office clipboard content on paste and cleans it to standards-compliant XHTML automatically. There is no separate "Paste from Word" button to teach, and no MsoNormal classes polluting the output. Set Options.AutoDetectWordPaste and it is on.

If you need a stricter cleanup policy, the Pasting event fires before clipboard content reaches the document. Inspect the HTML, modify it, replace it, or cancel the paste outright before the content becomes part of your WPF application's data.

Word content pasted into the WPF HTML editor with clean source output shown beside it

Insert Images From File, URL, Clipboard, or Base64

Business users paste screenshots, insert logos, link product images, and expect the content to survive when it is emailed or published. The editor supports images from a local file, an absolute URL, or directly from the clipboard.

Clipboard images can be embedded as Base64 Data URIs so the HTML is self-contained, or saved to a base folder and referenced by relative path using the editor's BaseUrl. Pasted screenshots and photos auto-resize to a sensible maximum width by default, controlled by MaxPastedImageWidth.

When you need to publish, EmbedLocalImagesAsBase64() walks the document and converts every local image to a Base64 Data URI in a single call. YouTube embedding is supported through the toolbar, with the option to add ?rel=0. Hyperlinks support cross-document bookmark targets through the hyperlink dialog.

Screenshot pasted into the WPF HTML editor and stored as a Base64 or BaseUrl referenced image

Spell Check Out of the Box in 14 Languages

Spell check should not become another installer project. It works the moment you drop the control in, with no native DLLs to copy and no dictionary files to bundle for the built-in languages. 14 Hunspell dictionaries are embedded directly in the control.

Set SpellCheckOptions.SpellCheckLanguage to English (US), English (GB), German, French, Spanish, Italian, Dutch, Danish, Swedish, Norwegian, Polish, Czech, Portuguese (Brazil), or Portuguese (Portugal). Or leave it on Same as Editor Language so it tracks the editor UI language.

The engine is a pure-managed Hunspell implementation. Inline red-squiggle and dialog-based modes are supported, along with a per-user custom dictionary. For another language, drop in any OpenOffice .dic / .aff pair. If you already have your own spell-check engine, plug it in through ISpellCheckerEngine.

Misspelled word underlined in the WPF HTML editor with spelling suggestions visible

Localized Editor UI in 14 Languages

European enterprise WPF apps cannot treat localization as a cosmetic afterthought. Set one property and the editor UI reflows:

editor.Language = EditorLanguage.German;

Every toolbar tooltip, dialog caption, dialog button, and context-menu item appears in the chosen language. Fourteen UI languages are bundled: English (US), English (UK), German, Dutch, French, Spanish, Italian, Danish, Polish, Norwegian, Czech, Swedish, Portuguese (Brazil), and Portuguese (Portugal).

UI language and spell-check language are independent. You can run a German UI with an English spell-check dictionary if users edit English content in a German shell. UI language is set with Language, spell-check language is set with SpellCheckOption.SpellCheckLanguage.

WPF HTML editor toolbar and dialog captions shown in German

Customize Every Toolbar Button

A WPF editor should not force your application to accept someone else's toolbar model. Show, hide, replace, or extend any toolbar button. Build a custom button entirely from XAML or code.

Override the click handler of any built-in button through ToolbarItemOverrider. That is useful when the editor's Save button should call into your application's save pipeline instead of opening a file dialog.

State-aware behavior comes for free: the SelectionChanged event and the StateQuery service report which formatting is active at the caret, so custom buttons can highlight or disable themselves correctly. To skip the built-in toolbar entirely, build your own around Editor, Formatting, Selection, and StateQuery.

Customized WPF HTML editor toolbar with XAML buttons and state-aware formatting icons

Remap Every Keyboard Shortcut

An embedded editor should not fight the host application for keyboard shortcuts. In a mature WPF app, the keyboard already belongs to menus, ribbons, commands, and user muscle memory.

The KeyBindings manager exposes binding, unbinding, overriding, disabling, enabling, and querying for editor actions represented by EditorActionId. Thirty-five actions are covered: bold, italic, underline, cut, copy, paste, undo, redo, search, spell check, ordered and unordered list commands, alignment commands, insert commands for table, image, hyperlink, symbol, and YouTube video, font color, highlight color, indent, outdent, and more.

Use it to keep familiar shortcuts where users expect them, or to let your host application's global commands win when the editor has focus.

C# code remapping WPF HTML editor shortcuts through KeyBindings and EditorActionId

Customize Every Dialog with the Included Source

WPF buyers often need more than a color change. They need dialogs that match a corporate design system, collect extra metadata, enforce business rules, or use the application's own picker screens.

The source code for every dialog ships in the trial and product package: Image Insert, Hyperlink, Search, Style Builder, Symbol Picker, Table, Table Cell, YouTube Embed, and the Spell Checker. Even without a Source Code License, you receive every dialog's source. Restyle them, change the layout, add fields, remove fields, then ship.

If you would rather replace a dialog entirely, every dialog is fronted by an interface: IImageDialog, IHyperlinkDialog, ISearchDialog, IStyleBuilderDialog, ISymbolDialog, ITableDialog, ITableCellDialog, IYouTubeVideoInsertDialog, and ISpellCheckerDialog. Assign your own ContextMenu through EditorContextMenuStrip.

Customized WPF image or table dialog launched from the HTML editor

Theme It with a Single ResourceDictionary

The editor uses standard WPF theming. Swap a single ResourceDictionary to retheme it for light mode, dark mode, or your own design system colors and typography. The XAML vector toolbar adapts to brushes you supply.

There is no proprietary skin engine to learn and no separate theme format to bolt on. It follows standard WPF resource resolution, the way you already style the rest of your application.

For teams that need to retemplate dialogs end to end or align deeply with a corporate WPF design system, the Source Code License includes the full source code of the control. That is why the WPF product speaks directly to buyers who expect customization, not just configuration.

Same WPF HTML editor shown with light, dark, and corporate ResourceDictionary themes

Intelligent Two-Way Table Editing

Tables are where many simple HTML editors fall apart. Users insert a table, edit a few cells, then the next time they open the dialog it no longer understands what is already there.

The two-way table dialog in 3.x reads the existing table's structure and styling back from the document: row count, column count, border style, cell padding, cell background color, and cell-level styling. Users continue editing without starting over.

For code-driven workflows, Content.TableAuthoringService exposes operations such as InsertRow, InsertColumn, MergeSelectedCells, and more. Cell merging can be toggled globally through the EnableTableCellMerge option.

WPF table dialog populated from an existing table inside the HTML editor

Visual CSS Style Builder at Design Time and Runtime

Not every user who formats an email letter, support reply, or ERP document template should be asked to write CSS. The visual CSS style builder is available at design time through the WPF property surface and at runtime from the editor toolbar.

End users pick font, size, color, background, border, margin, and padding from familiar controls. The editor writes the equivalent inline or class-scoped CSS into the document.

To add your own pages to the style builder, for example a Corporate Branding tab with your standard color palette, implement IEditorStylePage and decorate the form with FormSelectorPageAttribute. That gives your application a supported extension point instead of a separate styling workaround.

WPF visual CSS style builder dialog with font, color, background, border, margin, and padding options

Mail-Merge Placeholder Support

Many business editors are not free-form text boxes. They are template builders. Users need to insert fields like customer name, invoice number, due date, ticket ID, assigned agent, or company name without hand-typing fragile tokens.

The editor exposes mail-merge placeholders through Content.MailMerge. Define the available fields, expose an opt-in placeholder toolbar through ShowPlaceholderToolbar, insert placeholders at the caret programmatically through InsertPlaceholder, and handle the PlaceholderInserted event when users insert one.

Your back-end merge code replaces the placeholders at send time. This is the workflow behind email templates, CRM messages, support replies, invoice notes, notification bodies, ERP letter composition, Dynamics NAV style email letters, and other document templates your WPF application needs to author.

Mail-merge placeholder inserted into a WPF HTML email template

Developer Power Features

Senior WPF developers need more than a toolbar. They need an API surface that can be driven from their own commands, bindings, save pipeline, and template workflow.

  • Content service. Read, set, insert, transform, and export HTML through the Content service. Sub-services for MailMerge and TableAuthoringService.
  • Caret service. Get and set caret position by point or by index through the Caret service.
  • Editor commands. Cut, copy, paste, undo, redo, search, replace, print, and command execution through the Editor service.
  • Formatting service. Apply bold, italic, underline, font, colors, alignment, lists, headings, and format removal through Formatting.
  • Selection service. Read selected HTML, select text, select all, and trim selections through Selection.
  • State query service. Ask whether the current selection is bold, italic, inside a table, undoable, or redoable, with 37 query methods through StateQuery.
  • HTML-Changed event. HtmlChanged fires immediately when the document changes.
  • Email-ready output. Content.GetEmailMessageWithLocalImagesEmbedded() returns a populated MailMessage with images embedded.
  • Enter-key behavior. Choose paragraph (<p>) or line-break (<br>) behavior through EnterKeyResponse.
C# code using WPF HTML editor services such as Content, Formatting, Selection, and StateQuery

Need it for WinForms?

Building a Windows Forms application instead of WPF? SpiceLogic offers a separate WinForms HTML Editor Control with its own landing page, documentation, and licensing.

The two products share design philosophy and API patterns but ship as separate controls optimized for each desktop UI stack.

Use this page for WPF applications. Use the WinForms page when your application is built on Windows Forms. That separation matters because a WPF team should evaluate WPF theming, XAML integration, and binding behavior, while a WinForms team should evaluate a control built for its own stack.

Hear From Our Clients