DxRichEdit.ModifiedChanged Event
Allows you to track unsaved document changes.
Namespace: DevExpress.Blazor.RichEdit
Assembly: DevExpress.Blazor.RichEdit.v24.2.dll
NuGet Package: DevExpress.Blazor.RichEdit
Declaration
[Parameter]
public EventCallback<bool> ModifiedChanged { get; set; }
Parameters
Type | Description |
---|---|
Boolean | A new property value. |
Remarks
The ModifiedChanged
occurs every time the Modified property value changes. The following example handles this event:
<DxRichEdit @ref="richEdit" Modified="@modified" @bind-DocumentContent="@documentContent"
ModifiedChanged="@((value) => OnModifiedChanged(value))" />
@code {
DxRichEdit richEdit { get; set; }
byte[] documentContent { get; set; }
bool modified { get; set; }
async Task OnModifiedChanged(bool value) {
/* 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 {
modified = value;
if (modified) {
// Your code
}
}
catch (OperationCanceledException e) {
Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
}
}
}
See Also