New WPF Features: Custom Speller Dictionary

This is part of a series on New WPF Features

In previous versions, adding a custom dictionary was an unsupported scenario. You could still do it but it required writing a bunch of code.

In this release, we have provided suport for adding custom dictionaries.

     <RichTextBox FontSize="24" SpellCheck.IsEnabled="true" >

            <SpellCheck.CustomDictionaries>

                  <sys:Uri>Dictionary1.lex</sys:Uri>

                  <sys1:Uri>\\dictServer\Dictionary3.txt</sys1:Uri>

            </SpellCheck.CustomDictionaries>

            <FlowDocument>

                  <Paragraph>Some Names: Zorig Lester </Paragraph>

                  <Paragraph>Misspelled: Zorg BlahBlah </Paragraph>

            </FlowDocument>

      </RichTextBox>

The dictionaries are plain text files and list the words to be updated.

For a non default locale (en-us) you can specify the locale ID at the top (#LID localeID). In the pic above, we are using the locale 2057 which corresponds to english-UK.

 

Share this post