blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-ac4c699c.md
Fires after the Rich Text Editor loses focus.
Namespace : DevExpress.Blazor.RichEdit
Assembly : DevExpress.Blazor.RichEdit.v25.2.dll
NuGet Package : DevExpress.Blazor.RichEdit
[Parameter]
public EventCallback LostFocus { get; set; }
The following code snippet handles the GotFocus and LostFocus events:
<DxRichEdit @ref="richEdit" LostFocus="@onLostFocus" GotFocus="@onGotFocus" />
@code {
DxRichEdit richEdit { get; set; }
async Task onLostFocus() {
/* Surround the code that contains an asynchronous operation with a try-catch block to handle
the OperationCanceledException. This exception is thrown when an asynchronous operation is canceled. */
try {
// Your code
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
async Task onGotFocus() {
try {
// Your code
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
}
See Also