Gets the collection of lexicon file locations that are used for custom spell checking.
Assembly: PresentationFramework (in PresentationFramework.dll)
Custom dictionaries use lexicon files, which are text files that have a .lex extension. Each line of a lexicon file contains a single word that is accepted as a legitimate spelling. The first line of the file can specify a locale identifier (LCID) that the dictionary applies to. If the locale is not specified, the dictionary applies to all languages. For more information, see Locale IDs. The following example shows the first few lines of a lexicon file for the English language.
#LID 1033 TextBlock TextBox ListBox
The lexicon files can be included in the application as content files installed on the local computer or as resource files compiled into a local referenced assembly. You can reference the file by using pack URIs. For more information, see Pack URIs in WPF.
To enable the spelling checker, set the SpellCheck.IsEnabled property to true on a TextBox or on any class that derives from TextBoxBase. All custom dictionaries for that TextBox are used in addition to the default spelling checker. For more information about the spelling checker, see SpellCheck.
The following example shows how to add two custom dictionaries to a RichTextBox. The first custom dictionary (customwords.lex) is added in XAML. The file is included in the application as a content file and copied to the output directory. To use the Uri element, you have to include the System namespace.
The second custom dictionary (customwords2.lex) is added in the Click event handler. The file is included as a resource file and compiled into the application assembly that is named WPFCustomDictionary.
<RichTextBox Margin="38,18,40,0" Name="richTextBox1" Height="45" VerticalAlignment="Top" SpellCheck.IsEnabled="True" > <SpellCheck.CustomDictionaries> <!-- customwords.lex is included as a content file--> <sys:Uri>pack://application:,,,/customwords.lex</sys:Uri> </SpellCheck.CustomDictionaries> </RichTextBox>
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)