doc/articles/features/spellchecking.md
Uno Platform provides optional spell-checking support for TextBox controls on all Skia-based targets. When enabled, misspelled words are underlined in red and opening the context menu (secondary click or long-press) on a misspelled word presents spelling suggestions.
Spell-checking is provided by the Uno.WinUI.SpellChecking package. To include it, add the SpellChecking feature to your project's UnoFeatures:
<UnoFeatures>
SpellChecking;
<!-- other features -->
</UnoFeatures>
Once enabled, any TextBox with IsSpellCheckEnabled="True" (the default) will display spell-checking visuals. An English (en_US) dictionary is included by default.
The default dictionary is English (en_US). To add spell-checking for other languages, load Hunspell-compatible dictionary files (.dic and .aff) at application startup using FeatureConfiguration.TextBox.CustomSpellCheckDictionaries.
Hunspell-compatible dictionaries are freely available from:
Download the .dic and .aff files for your target language and include them in your project as embedded resources.
Add the dictionary files to your project and set their Build Action to Embedded Resource.
Load the dictionaries at application startup (e.g., in App.xaml.cs):
using Uno.UI;
// Load a French dictionary from embedded resources
var assembly = typeof(App).Assembly;
var frDic = assembly.GetManifestResourceStream("MyApp.Dictionaries.fr_FR.dic");
var frAff = assembly.GetManifestResourceStream("MyApp.Dictionaries.fr_FR.aff");
FeatureConfiguration.TextBox.CustomSpellCheckDictionaries = new()
{
(frDic!, frAff!)
};
Multiple dictionaries can be loaded simultaneously. The spell-checker validates words against all loaded dictionaries — a word is considered correct if it is found in any dictionary:
FeatureConfiguration.TextBox.CustomSpellCheckDictionaries = new()
{
(frDic!, frAff!),
(deDic!, deAff!)
};