WPF SpellCheck on Windows 11 systems

76 Views Asked by At

I have a problem with SpellChecking and CustomDictionaries on Windows 11 systems. In the XAML file exists an TextBox, where the SpellCheck is enabled.

   <TextBox
        Name="SpellCheckTextBox"
        Grid.Column="1"
        Height="20"
        Margin="0 0 5 0"
        VerticalAlignment="Center"
        SpellCheck.IsEnabled="True"
        />

The systemwide spellchecking works very well, but when the user add a own word to the CustomDictionary, write this word again, it is mark as wrong again.

I tried this, to test my approach:

    private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
    {
        var dictionaries = SpellCheck.GetCustomDictionaries(SpellCheckTextBox);
        dictionaries.Add(new Uri("file:///C:/Temp//TestApp/Dictionaries/dictionary_de-DE.lex"));
    }

The file already exists and the content is like this

thisIsATest
secondTest

On Windows 10 system, this works very well, no issues. Microsoft descripe the SpellCheck and CustomDictionaries here and I did it in the same way.

https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.spellcheck.customdictionaries?view=windowsdesktop-7.0

0

There are 0 best solutions below