Fields.ShowAllFieldResultsAsync(Boolean, CancellationToken) Method
Displays every field as the field result.
Namespace: DevExpress.Blazor.RichEdit
Assembly: DevExpress.Blazor.RichEdit.v24.2.dll
NuGet Package: DevExpress.Blazor.RichEdit
Declaration
public ValueTask ShowAllFieldResultsAsync(
bool doInAllSubDocuments = false,
CancellationToken cancellationToken = default(CancellationToken)
)
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
doInAllSubDocuments | Boolean | False |
|
cancellationToken | CancellationToken | null | An object that propagates a cancellation notification. |
Returns
Type | Description |
---|---|
ValueTask | A structure that stores an awaitable result of an asynchronous operation. |
Remarks
A field has the {Code}Result>
structure in the text buffer, for instance, {DATE}11/2/2020>
. The Code specifies how the Result should be calculated when the field is updated.
The Rich Text Editor can display a field as a code or result. Call the ShowAllFieldResultsAsync(Boolean)
method to display fields as field results, or call the ShowAllFieldCodesAsync(Boolean, CancellationToken) method to display fields as field codes.
<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.ShowAllFieldResultsAsync();
await documentAPI.Fields.ShowAllFieldCodesAsync();
@* ... *@
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
Use a field’s IsShowCode property to get whether the field’s code or result is visible. Call the ToggleViewAsync(Field, CancellationToken) method to change the view mode of a field.