Back to Devexpress

DxRichEdit.RedoAsync(CancellationToken) Method

blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-dot-redoasync-x28-system-dot-threading-dot-cancellationtoken-x29.md

latest2.0 KB
Original Source

DxRichEdit.RedoAsync(CancellationToken) Method

Reapplies the last action.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

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

Optional Parameters

NameTypeDefaultDescription
cancellationTokenCancellationTokennull

An object that propagates a cancellation notification.

|

Returns

TypeDescription
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:

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

DxRichEdit Class

DxRichEdit Members

DevExpress.Blazor.RichEdit Namespace