# Product Architecture

> How TX Spell .NET for WPF is built: TXSpell.dll and TXSpell.WPF.dll, the language data folders, the XAML resource behind TextControl.SpellChecker, and packages.

- **Product:** TX Spell .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for WPF > Overview > Product Architecture
- **1581 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/architecture/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/architecture/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/architecture/llms-full.txt

---

Knowing how the parts of TX Spell .NET for WPF fit together makes it easier to add it to a project and to deploy the result. The sections below describe the assemblies and classes, the language data they read, how TX Text Control and other controls use the spell checker, and what each NuGet package brings.

### How the Parts Fit

```text
 WPF application
 ┌──────────────────────────────────────────────────────────────────┐
 │  TextControl ── SpellChecker ──►┐  (key of a XAML resource)      │
 │  RichTextBox / TextBox ─ Check ─►  TXSpellChecker                │
 │                                  (dialogs, menu items, events)   │
 │                                  TXSpell.WPF.dll                 │
 │                                         │                        │
 │  Console, service, server ─────────►  TXSpell                    │
 │                                  (checking, suggestions,         │
 │                                   hyphenation, synonyms,         │
 │                                   language detection)            │
 │                                  TXSpell.dll                     │
 └─────────────────────────────────────────┬────────────────────────┘
                                           │ reads
     Dictionaries   HyphenationLists   SynonymLists   LanguageRecognition
```

TX Spell .NET has one engine, *TXSpell.dll*, shared by all its products, and one assembly with the user interface for each platform, here *TXSpell.WPF.dll*. Both read the language data from four folders next to the application.

### The Two Classes

The spell checker you declare in XAML is [TXSpellChecker](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/components/txspellchecker/llms-full.txt), in the namespace `TXTextControl.WPF.Proofing` of *TXSpell.WPF.dll*. It brings the dialogs, the context menu items and the events, and it initializes itself when it is connected to a `TextControl`. [TXSpell](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/components/txspell/llms-full.txt), in the namespace `TXTextControl.Proofing` of *TXSpell.dll*, is the engine for code, with no user interface and no events; [TXSpell](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/components/txspell/#what-txspell-is) compares the two in a table.

Both classes check text, create suggestions, hyphenate, find synonyms and detect languages with the same members, such as [Check](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/check-method/llms-full.txt), [CreateSuggestions](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/createsuggestions-method/llms-full.txt) and [GetHyphenationPoints](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/gethyphenationpoints-method/llms-full.txt). The classes of the language data, such as [OpenOfficeDictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/openofficedictionary/llms-full.txt), [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) and [HyphenationList](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/llms-full.txt), are shared by both and are in the namespace `TXTextControl.Proofing`, which WPF code uses together with `TXTextControl.WPF.Proofing`. [Components](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/components/llms-full.txt) describes each part.

The texts of the dialogs are resources: English is built in, German comes as the satellite assembly *de\\TXSpell.resources.dll*, and [Localization and Resource Kit](https://docs.textcontrol.com/tx-spell-dotnet-wpf/user-interface/localization/llms-full.txt) adds other languages.

### The Language Data

The spell checker reads its language data from four folders: *Dictionaries* for spell checking and suggestions, *HyphenationLists* for hyphenation, *SynonymLists* for synonyms and *LanguageRecognition* for language detection. By default, it finds them next to the application, and on the development machine below the *\\Assembly* folder of the installation; a property per folder, such as [DictionariesDirectoryPath](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/dictionariesdirectorypath-property/llms-full.txt), moves them elsewhere. [Installing Dictionaries and Language Data](https://docs.textcontrol.com/tx-spell-dotnet-wpf/installation/language-data/#the-four-folders) lists the files of each folder and where the spell checker looks.

### How TX Text Control Uses the Spell Checker

A `TextControl` gets its spell checker through its [SpellChecker](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellchecker-property/llms-full.txt) property, which holds the key of the spell checker in the resources of the window. From then on, the editor drives the checking, and the spell checker answers:

1. The user types a word. When the word is complete, the `TextControl` asks the spell checker whether it is spelled correctly.
2. The `TextControl` underlines the misspelled words and keeps them in its [MisspelledWords](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/misspelledwords-property/llms-full.txt) collection, which holds the misspelled words of the part of the document with the input focus, such as the main text, a header or a text frame.
3. A right-click on an underlined word opens the spell check menu; the menu and the dialogs correct the word in the document.

[IsSpellCheckingEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/isspellcheckingenabled-property/llms-full.txt), [IsHyphenationEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/ishyphenationenabled-property/llms-full.txt) and [IsLanguageDetectionEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/islanguagedetectionenabled-property/llms-full.txt) of the `TextControl` switch the three services on. [As-You-Type Checking](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/as-you-type/llms-full.txt) describes the connection in detail.

### How Other Controls Use It

A `RichTextBox` or a `TextBox` doesn't know the spell checker. Your application does the work the `TextControl` does by itself:

1. It passes the text to [Check](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/check-method/llms-full.txt), which fills [IncorrectWords](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/incorrectwords-property/llms-full.txt) with the misspelled words and their positions.
2. It marks the words, or opens the spell check dialog for them.
3. It applies each correction the user makes in the [IncorrectWordChanging](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/incorrectwordchanging-event/llms-full.txt) event.

[Checking on Demand](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/on-demand/llms-full.txt) shows these steps with a `TextBox`.

### The NuGet Packages

`TXTextControl.TXSpell.WPF.SDK` contains both assemblies, and `TXTextControl.TXSpell.Core.SDK` contains *TXSpell.dll* only, for code without a user interface. Both bring the US English language data and the license file, and neither depends on TX Text Control: a project with a `TextControl` installs the TX Text Control package as well. [Package Overview](https://docs.textcontrol.com/tx-spell-dotnet-wpf/installation/nuget/packages/llms-full.txt) lists what each package contains.

### One Spell Checker for Many Controls

One `TXSpellChecker` serves every `TextControl` and every other control of a window. The dictionaries are loaded once, and a word the user adds to a user dictionary is accepted in all editors at once. [Checking Multiple Controls](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/multiple-controls/llms-full.txt) shows how to share it and how one dialog checks several controls.

### Next Steps

- [Components](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/components/llms-full.txt): what each part does.
- [Supported Platforms](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/platforms/llms-full.txt): the .NET versions and tools.
- [Loading and Managing Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/dictionaries/managing/llms-full.txt): the dictionaries in code.
- [Getting Started](https://docs.textcontrol.com/tx-spell-dotnet-wpf/getting-started/llms-full.txt): a first application.

---

## Nearby

- **Previous:** [Introduction](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/introduction/llms-full.txt)
- **Next:** [Components](https://docs.textcontrol.com/tx-spell-dotnet-wpf/overview/components/llms-full.txt)
