Sample projects on GitHub
Open the WPF sample projects on GitHub to try the HTML Editor in working C# and VB.NET applications. Start with Quickstart, then choose a sample for the feature you want to add.

Running the samples
Use Windows and Visual Studio with the .NET desktop development workload and .NET Framework 4.8 targeting pack for the default net48 projects. Clone the GitHub repository, open WpfHtmlEditorSamples.sln, set 01-Quickstart-CS or 01-Quickstart-VB as the startup project, then press F5.
If you use Git and the .NET CLI, run these commands one line at a time from a terminal:
git clone https://github.com/spicelogic/wpf-html-editor-control-samples.git
cd wpf-html-editor-control-samples
dotnet build WpfHtmlEditorSamples.sln
dotnet run --project 01-Quickstart-CS You can also open WpfHtmlEditorSamples.sln in Visual Studio and set any project as the startup project.
The sample code is MIT licensed, so you can copy any of it straight into your own application. The control itself remains commercial and is installed from NuGet.
What is in the repository
Ten samples, each with a C# project and a VB.NET twin side by side in a matching -VB folder, both wired into the same solution.
- 01-Quickstart-CS (VB.NET) - the editor filling a window in XAML, starting content through
BodyHtml, and a status bar driven byHtmlChanged. - 02-MvvmDataBinding-CS (VB.NET) -
BodyHtmlbound two-way to a view model, and why you callUpdateBindingsbefore reading a bound value. - 03-ThemeAndAppearance-CS (VB.NET) - border colour and thickness, the document font, and switching
EditorModebetween the design view and the source view. - 04-ToolbarCustomization-CS (VB.NET) - hiding built-in buttons, moving editor commands into a toolbar of your own, and adding buttons that act on the document.
- 05-MailMergeTemplate-CS (VB.NET) - registering merge fields, the built-in placeholder toolbar, and previewing a template with a record substituted in.
- 06-Localization-CS (VB.NET) - switching the editor UI language at runtime, an independent spell-check dictionary language, and a JSON file for overriding individual strings.
- 07-CustomSpellChecker-CS (VB.NET) - plugging your own spell-check engine in behind the editor's inline checking.
- 08-CustomDialog-CS (VB.NET) - replacing every built-in dialog (image, hyperlink, table, symbol, search, spell check, style builder, colour picker) with your own WPF windows, so the editor carries your branding.
- 09-CustomContextMenu-CS (VB.NET) - replacing the right-click menu with your own commands.
- 10-FullEditorDemo-CS (VB.NET) - the wider tour: the full toolbar, rich starting content, and live spell checking with a language picker.
The gotcha the binding sample is built around
The editor hosts a live document rather than a plain string, so a bound view model property reflects whatever the binding last pushed into it. If you read that property from code which runs without the editor losing focus first - a keyboard shortcut, a background timer, a button that does not move focus - the view model is a moment behind the user's last keystrokes. Call UpdateBindings before reading, and the current content is pushed into the dependency properties first. Sample 02 demonstrates how to keep the editor and view model in sync.
Which .NET version you need
Use whichever target framework your application already uses. The NuGet package ships binaries for .NET Framework 4.5, 4.7.2 and 4.8, plus .NET 5 through .NET 10 on Windows.
The sample projects intentionally target net48 by default. This provides broad out-of-the-box Visual Studio compatibility and avoids requiring the latest .NET SDK merely to open and build a sample. It does not limit the control or sample code to .NET Framework 4.8.
To use another supported target, change the Target framework from the project's Application property page in Visual Studio. To retarget every sample at once, change the single shared setting in Directory.Build.props at the repository root:
<TargetFramework>net48</TargetFramework> For example, change it to net10.0-windows to build the samples on .NET 10. NuGet automatically selects the matching package asset for the framework you choose.
Every sample is verified building on net45, net472, net48, net8.0-windows and net10.0-windows. The sample code already includes the small framework-specific adjustments it needs, so retargeting does not require manual source edits.
If your company blocks GitHub
Only if your company blocks the GitHub website, download the sample package from SpiceLogic, which includes the sample projects. For a trusted downloaded ZIP, open its Properties and select Unblock before extracting it; see Microsoft's guidance on Mark of the Web build errors if Visual Studio reports MSB3821.
Building on Windows Forms as well
The WinForms edition has its own sample repository covering Word paste cleanup, data binding, custom dialogs and mail merge: github.com/spicelogic/winforms-html-editor-control-samples. See the WinForms HTML Editor control for the product itself.