I'm trying to change my SpellChecker language. Here is my code:
Public Class MdnStringBox
Inherits TextBox
' Implements IGetDefault
Private mvarSpellEditor As MdnTextSpellEditor
Public mvarEditor As IEditorProperties
Public mvarSpellChecker As SfSpellChecker
Private Shared mvarKeysToMiss As New List(Of Key) _
(New Key() {Key.LeftAlt, Key.RightAlt, Key.LeftCtrl, Key.RightCtrl, Key.LeftShift, Key.RightShift, Key.LWin, Key.RWin})
Public Sub New()
MinHeight = 23
TextAlignment = Windows.TextAlignment.Justify
Padding = New Thickness(2)
'SpellCheck.IsEnabled = True
'SpellCheck.SpellingReform = SpellingReform.Postreform
mvarSpellChecker = New SfSpellChecker()
mvarSpellChecker.Dictionaries = New DictionaryCollection()
Dim lvarIspellDictionary As IspellDictionary = New IspellDictionary()
lvarIspellDictionary.Culture = New CultureInfo(Thread.CurrentThread.CurrentCulture.Name)
lvarIspellDictionary.GrammarUri = New Uri("/WpfCom;component//Dictonaries/pl-PL.aff", UriKind.Relative)
lvarIspellDictionary.DictionaryUri = New Uri("/WpfCom;component//Dictonaries/pl-PL.dic", UriKind.Relative)
mvarSpellChecker.Dictionaries.Add(lvarIspellDictionary)
mvarSpellChecker.Culture = New CultureInfo("pl-PL")
mvarSpellEditor = New MdnTextSpellEditor(Me)
mvarEditor = mvarSpellEditor
mvarSpellChecker.PerformSpellCheckUsingContextMenu(mvarEditor)
End Sub
Private Sub SpellCheckerDialog() Handles Me.MouseDoubleClick
mvarSpellChecker.PerformSpellCheckUsingDialog(mvarEditor)
End Sub
But when i'm trying to use it i've got an error: Element with this key was already added.