Events in Rich Text Editor for WPF
- 2 minutes to read
This document is a brief overview of events implemented in the RichEditControl.
When a new document is created in RichEditControl via the RichEditControl.CreateNewDocument method or the CreateEmptyDocumentCommand command, the RichEditControl.EmptyDocumentCreated event is raised.
When a document is loaded in RichEditControl, the RichEditControl.DocumentClosing event occurs. It enables you to take the necessary steps before the content of the previously loaded document is discarded. Then the RichEditControl.BeforeImport event is raised, enabling you to configure the importer, and the RichEditControl.DocumentLoaded event indicates that the loading process is finalized.
The RichEditControl.ContentChanged event indicates changes in the control content, while the RichEditControl.ModifiedChanged event occurs when the current document is modified and the RichEditControl.Modified property is changed. The ModifiedChanged event is not raised when a document is loaded or saved.
Note
If the loaded document contains fields and RichEditMailMergeOptions.ViewMergedData is set to true, the fields are automatically updated and the ModifiedChanged event fires.
When a document is saved, the RichEditControl.BeforeExport event occurs, enabling you to customize export settings (e.g., specify the location to store external content when the document is saved in HTML).
A special RichEditControl.UnhandledException event provides an easy-to-use method for processing exceptions that are not handled by RichEditControl.
Some events are implemented to allow the customization of RichEditControl. The RichEditControl.PopupMenuShowing event allows you to modify a popup menu before it is shown.
User activity can be tracked by events such as RichEditControl.SelectionChanged, RichEditControl.HyperlinkClick, RichEditControl.StartHeaderFooterEditing and RichEditControl.ZoomChanged.
The mail merge process is also accompanied by events - RichEditControl.MailMergeStarted, RichEditControl.MailMergeRecordStarted, RichEditControl.MailMergeRecordFinished and RichEditControl.MailMergeFinished.
Special purpose events are RichEditControl.AutoCorrect and RichEditControl.CalculateDocumentVariable.
For more information, refer to the list of RichEditControl class members in the RichEditControl topic.