Clonkex
Clonkex

Reputation: 3637

WPF spell check only custom dictionary

Our app works with many languages. I need to be able to specify which language to use for each textbox. That seems to be fine; I can just do this:

<TextBox SpellCheck.IsEnabled="True"
         Language="en-gb"/>

Of course this requires that the user has the appropriate language pack installed. That's not completely horrible (although seems very archaic and restrictive), but the issue is that the Windows 10 en-gb dictionary allows "ize" spellings (for some reason?) and our client requires that they stick strictly to "ise" spellings.

So my thought was ok, what if we just include a custom dictionary for each supported language with the app? Seems legit:

<TextBox SpellCheck.IsEnabled="True"
         Language="">
    <SpellCheck.CustomDictionaries>
        <sys:Uri>dict/en-gb-ise.lex</sys:Uri>
    </SpellCheck.CustomDictionaries>
</TextBox>

...except that if the Language property is set to something that doesn't exist, spell checking is disabled. Sigh.

How can I specify a custom dictionary for each textbox individually that completely overrides whatever OS-supplied dictionaries exist?

Upvotes: 2

Views: 631

Answers (1)

mm8
mm8

Reputation: 169160

How can I specify a custom dictionary for each textbox individually that completely overrides whatever OS-supplied dictionaries exist?

I am afraid you cannot disable or override the default dictionary. This is not supported.

As stated in the docs, custom dictionaries are only used in additon to the default spelling checker.

Upvotes: 1

Related Questions