This event is called directly before a change is applied to the document.

C# | Visual Basic | Visual C++ |
event EventHandler<TextChangeEventArgs> TextChanging
Event TextChanging As EventHandler(Of TextChangeEventArgs)
event EventHandler<TextChangeEventArgs^>^ TextChanging { void add (EventHandler<TextChangeEventArgs^>^ value); void remove (EventHandler<TextChangeEventArgs^>^ value); }

It is invalid to modify the document within this event handler.
Aborting the change (by throwing an exception) is likely to cause corruption of data structures
that listen to the Changing and Changed events.
Assembly: ICSharpCode.AvalonEdit (Module: ICSharpCode.AvalonEdit.dll) Version: 5.0.0.4238