Question

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.

enter image description here

What am I doing wrong?

Was it helpful?

Solution

Correct answer: the dictionary should be encoded in UTF-16.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top