Back to Devexpress

DxRichEdit.BarItemExceptionRaised Event

blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-2c308e3d.md

latest2.5 KB
Original Source

DxRichEdit.BarItemExceptionRaised Event

Allows you to handle exceptions that occur after a user interacts with an item in the menu bar.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
[Parameter]
public EventCallback<BarItemExceptionEventArgs> BarItemExceptionRaised { get; set; }

Event Data

The BarItemExceptionRaised event's data class is BarItemExceptionEventArgs. The following properties provide information specific to this event:

PropertyDescription
ExceptionReturns an exception that details the cause of the failure.
HandledGets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.

Remarks

The Rich Text Editor runs asynchronous code to respond to user actions. Use the BarItemExceptionRaised event to handle runtime exceptions that occur after a user interacts with a build-in or custom item in the menu bar.

The following code snippet writes log messages for exeptions that occur after a user interacts with a custom ribbon:

razor
@inject ILogger<RibbonCustomization> Logger;
@using Microsoft.Extensions.Logging;

<DxRichEdit CustomizeRibbon=OnCustomizeRibbon />

@code {
    void OnCustomizeRibbon(IRibbon ribbon) {
        // ...
    }
    void OnBarItemExceptionRaised(BarItemExceptionEventArgs args) {
        Logger.LogError(args.Exception, args.Exception.Message);
        args.Handled = true;
    }
}

See Also

DxRichEdit Class

DxRichEdit Members

DevExpress.Blazor.RichEdit Namespace