Skip to main content

DxRichEdit.LostFocus Event

Fires after the Rich Text Editor loses focus.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v23.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

[Parameter]
public EventCallback LostFocus { get; set; }

Remarks

The example below demonstrates how to handle 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