Fields.UpdateAllAsync(Boolean, CancellationToken) Method
Updates every field in the current sub-document or in all sub-documents.
Namespace: DevExpress.Blazor.RichEdit
Assembly: DevExpress.Blazor.RichEdit.v24.2.dll
NuGet Package: DevExpress.Blazor.RichEdit
#Declaration
public ValueTask UpdateAllAsync(
bool doInAllSubDocuments = false,
CancellationToken cancellationToken = default(CancellationToken)
)
#Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
do |
Boolean | False |
|
cancellation |
Cancellation |
null | An object that propagates a cancellation notification. |
#Returns
Type | Description |
---|---|
Value |
A structure that stores an awaitable result of an asynchronous operation. |
#Remarks
Update fields to calculate and display the field results.
The following example shows how you can update every field in all sub-documents:
<DxRichEdit @ref="@richEdit" />
@code {
DxRichEdit richEdit;
Document documentAPI;
@* ... *@
/* 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 {
documentAPI = richEdit.DocumentAPI;
@* ... *@
await documentAPI.Fields.UpdateAllAsync(true);
@* ... *@
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
The UpdateAsync(Field, CancellationToken) method allows you to update a field.