Back to Devexpress

DxRichEdit.LostFocus Event

blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-ac4c699c.md

latest1.8 KB
Original Source

DxRichEdit.LostFocus Event

Fires after the Rich Text Editor loses focus.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

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

Remarks

The following code snippet handles the GotFocus and LostFocus events:

razor
<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

GotFocus

FocusAsync(CancellationToken)

DxRichEdit Class

DxRichEdit Members

DevExpress.Blazor.RichEdit Namespace