Skip to main content

DxRichEdit.RedoAsync(CancellationToken) Method

Reapplies the last action.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v24.1.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public ValueTask<bool> RedoAsync(
    CancellationToken cancellationToken = default(CancellationToken)
)

Optional Parameters

Name Type Default Description
cancellationToken CancellationToken null

An object that propagates a cancellation notification.

Returns

Type Description
ValueTask<Boolean>

A structure that stores an awaitable result of an asynchronous operation.

Remarks

The Rich Text editor keeps track of user actions. Click the Redo button to repeat the actions. You can also use the RedoAsync method to redo the last action from code.

The code snippet below adds new text to the documents, and undoes and redoes this operation:

<DxRichEdit @ref=rich />

@code {
    DxRichEdit rich;
    async Task ModifyDocumentContent() {
        Document documentApi = rich.DocumentAPI;
        documentApi.BeginUpdate();
        Paragraph body = await documentApi.Paragraphs.CreateAsync(0);
        TextSpan text = await documentApi.AddTextAsync(0, "New text");
        documentApi.EndUpdate();
        await rich.UndoAsync();
        await rich.RedoAsync();
    }
    @* ... *@
}
See Also