void richEdit1_Loaded(object sender, RoutedEventArgs e) { DevExpress.Xpf.SpellChecker.SpellChecker spellChecker = SpellCheckerHelper.SpellChecker; spellChecker.SpellCheckMode = SpellCheckMode.AsYouType; SpellCheckerOpenOfficeDictionary dictionary = LoadGreekDictionary(); SpellCheckerHelper.SpellChecker.Dictionaries.Add(dictionary); SpellCheckerHelper.SpellChecker.Culture = dictionary.Culture; this.richEdit1.SpellChecker = spellChecker; }
static DevExpress.Xpf.SpellChecker.SpellChecker CreateSpellChecker() { SpellCheckTextControllersManager.Default.RegisterClass(typeof(RichEditControl), typeof(RichEditSpellCheckController)); DevExpress.Xpf.SpellChecker.SpellChecker spellChecker = new DevExpress.Xpf.SpellChecker.SpellChecker(); spellChecker.Culture = new CultureInfo("en-US"); try { RegisterDictionary(spellChecker, GetDefaultDictionary()); RegisterDictionary(spellChecker, GetCustomDictionary(spellChecker)); } catch { } return(spellChecker); }
static SpellCheckerDictionaryBase GetCustomDictionary(DevExpress.Xpf.SpellChecker.SpellChecker spellChecker) { return(new SpellCheckerCustomDictionary("CustomEnglish.dic", spellChecker.Culture)); }
static void RegisterDictionary(DevExpress.Xpf.SpellChecker.SpellChecker spellChecker, SpellCheckerDictionaryBase dic) { dic.Culture = spellChecker.Culture; spellChecker.Dictionaries.Add(dic); }