wpf-devexpress-dot-xpf-dot-richedit-dot-richeditcontrol-7f1c0b20.md
Occurs after a document is loaded into the RichEdit control.
Namespace : DevExpress.Xpf.RichEdit
Assembly : DevExpress.Xpf.RichEdit.v25.2.dll
NuGet Package : DevExpress.Wpf.RichEdit
public event EventHandler DocumentLoaded
Public Event DocumentLoaded As EventHandler
The DocumentLoaded event's data class is EventArgs.
The DocumentLoaded event fires after executing the RichEditControl.LoadDocument or Document.LoadDocument method and after specifying values for the following properties:
The DocumentLoaded fires when the document model is built and the loaded document is valid. Handle the DocumentLayout.DocumentFormatted event to check the loaded document’s layout.
The following code snippet updates fields in the main body of a loaded document:
richEditControl.LoadDocument("FirstLook.docx");
richEditControl.DocumentLoaded += RichEditControl_DocumentLoaded;
private void RichEditControl1_DocumentLoaded(object sender, EventArgs e)
{
richEditControl1.BeginInvoke(new Action(() =>
{
if (richEditControl1.Document.Fields.Count != 0)
{
richEditControl1.Document.Fields.Update();
}
}));
}
Private Sub RichEditControl1_DocumentLoaded(ByVal sender As Object, ByVal e As EventArgs)
richEditControl1.BeginInvoke(New Action(Sub()
If richEditControl1.Document.Fields.Count <> 0 Then
richEditControl1.Document.Fields.Update()
End If
End Sub))
End Sub
See Also