Wpf uses #LID to indicate the language or dialect of the dictionary which it will pick up from the current localization.
e.g.#LID 2057 = UK location
Must include
- the System namespace in xaml,
- SpellCheck.IsEnabled="True" in the control,
- location of the dictionary.
Best set build action of the dictionary to embedded resource.
<Window ...
xmlns:sys="clr-namespace:System;assembly=System">
<!-- Must include System namespace in xaml -->
<TextBox SpellCheck.IsEnabled="True">
<SpellCheck.CustomDictionaries>
<!-- List of dictionaries to use -->
<!-- hard-coded -->
<sys:Uri>c:\pathToDictionary\uk.lex</sys:Uri>
<!-- OR: Embedded resource -->
<sys:Uri>pack://application:,,,/MyWpfProject;component/uk.lex</sys:Uri>
<!-- Must set uk.lex Build Action = Embedded Resource -->
</SpellCheck.CustomDictionaries>
</TextBox>
MyWpfProject - being the name of the application, in this example.
No comments:
Post a Comment