To enter text, I use the RichTextBox.
<RichTextBox x:Name="FlowDocumentViewer" Language="en"/>
I turn on the spell checker. To support the Russian language, I add customise dictionary.
try
{
this.FlowDocumentViewer.SpellCheck.SpellingReform = SpellingReform.PreAndPostreform;
Uri uri = new Uri("Resources/Russian.lex", UriKind.Relative);
if (!this.FlowDocumentViewer.SpellCheck.CustomDictionaries.Contains(uri))
{
this.FlowDocumentViewer.SpellCheck.CustomDictionaries.Add(uri);
}
this.FlowDocumentViewer.SpellCheck.IsEnabled = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
But it is not working correctly.
What am I doing wrong?
Correct answer: the dictionary should be encoded in UTF-16.