GitHub Examples
The GitHub organization TextControl has no WPF application with TX Spell .NET: the WPF samples come with the setup, and Spell Checking Examples lists them. A few repositories still help a WPF developer, because they use the TXSpell class, which checks text without a user interface and is part of TX Spell .NET for WPF as well.
Samples That Apply to WPF
| Example | What it shows | Where |
|---|---|---|
| Spell checking Web API | An ASP.NET Core Web API that checks text, creates suggestions and synonyms and detects languages with TXSpell, as described in Building a Spell Checking Web API in ASP.NET Core. TXTextControl.TXSpell.Core.SDK 11.0.0, .NET 8, C# | TXTextControl.Core.Spell.WebAPI |
| Validation in ASP.NET Web Forms | A validator that checks the text of a form field on the server with TXSpell and shows the first suggestion, as described in Using TX Spell .NET in ASP.NET. TX Spell .NET 10.0, .NET Framework 4.0, C# | TXSpell.Web |
The code that calls TXSpell works the same way in a WPF application; only the user interface around it differs.
Document Editor Sample
The Document Editor of TX Text Control .NET Server gets its spell checker from TXTextControl.TXSpell.Core.SDK, which is part of TX Spell .NET for WPF as well. This repository manages the user dictionaries of the editor:
| Example | What it shows | Where |
|---|---|---|
| User dictionaries in the Document Editor | An ASP.NET MVC application with the Document Editor of TX Text Control .NET Server that lists the user dictionaries (.txd) stored on the server, loads the chosen one into the editor with loadUserDictionary and saveUserDictionary of the JavaScript API, and saves the words users added back to the server through a Web API, as described in Loading and Saving User Dictionaries in TextControl.Web. TXTextControl.Web 33.0.0, .NET Framework 4.8, C# and JavaScript | TextControl.Web.MVC.UserDictionary |
Windows Forms Samples
These repositories are Windows Forms applications. The techniques carry over to WPF, but the code uses the Windows Forms controls:
| Example | What it shows | Where |
|---|---|---|
| AutoCorrect of two initial capitals | A word that starts with two capital letters is corrected while the user types in TX Text Control, as described in AutoCorrect: TWo INitial CApitals. TX Spell .NET 11.0 with TX Text Control 34.0 for Windows Forms | TextControl.Spelling.AutoCorrect |
| Interactive suggestions | A panel of suggestions below a misspelled word while the user types, as described in Interactive Spelling Suggestions Using TX Spell .NET. TX Spell .NET 11.0 with TX Text Control 33.0 for Windows Forms | TextControl.Spelling.AutoText |
Run a Sample
Clone the repository and open the solution or project file at its root in Visual Studio. The Web API is a .NET 8 project in the folder txspellwebapi, which the .NET CLI builds and runs:
git clone https://github.com/TextControl/TXTextControl.Core.Spell.WebAPI.git
cd TXTextControl.Core.Spell.WebAPI/txspellwebapi
dotnet restore
dotnet run
None of the repositories contains a nuget.config file. The Web API gets TXTextControl.TXSpell.Core.SDK from the package source Text Control Offline Packages that the setup adds; see Configuring Package Sources. The other samples reference the assemblies of TX Spell .NET directly.
Update an Older Sample
- Assembly references. The .NET Framework samples reference the assemblies of version 10.0 or 11.0, some with a path to an earlier installation directory. Remove the references and add them again from the Assembly folder of your installation.
- NuGet packages. A WPF project on .NET uses
TXTextControl.TXSpell.WPF.SDK, and a project without a user interfaceTXTextControl.TXSpell.Core.SDK. The packages of version 11.0 require .NET 8 or higher. Update them to the current version, 11.0.1. See Package Overview. - Breaking changes. Breaking Changes lists what changed between the versions.
Upgrading from Previous Versions describes the move of a project to the current version.
Next Steps
- Spell Checking Examples: the WPF samples of the setup.
- Dictionary and Language Examples: dictionaries, hyphenation, synonyms and language detection.
- Getting Started: build a first WPF application with the spell checker.