public RedUnderlineAdorner(SpellTextBox textbox) : base(textbox) { sizeChangedEventHandler = new SizeChangedEventHandler( delegate { SignalInvalidate(); }); routedEventHandler = new RoutedEventHandler( delegate { SignalInvalidate(); }); scrollChangedEventHandler = new ScrollChangedEventHandler( delegate { SignalInvalidate(); }); textbox.SizeChanged += sizeChangedEventHandler; textbox.SpellcheckCompleted += routedEventHandler; textbox.AddHandler(ScrollViewer.ScrollChangedEvent, scrollChangedEventHandler); }
public SpellCheckerVM(SpellChecker kurdspell, SpellTextBox parent) { _spellChecker = kurdspell; _box = parent; Words = new List <Word>(); MisspelledWords = new ObservableCollection <Word>(); IgnoredWords = new List <Word>(); SuggestedWords = new ObservableCollection <Word>(); }
void SignalInvalidate() { box = (SpellTextBox)this.AdornedElement; box.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)InvalidateVisual); }