BlazorPlus
BlazorPlus copied to clipboard
How to handle exception when a component can not inherit BlazorPlusComponentBase
Hi,I'm using your BlazorPlus.It's very cool you just throw exception and caught by blazorsession.But some component are not able to inherit from BlazorPlusComponentBase.So is there any solution to handle this situation? Thanks.
Try Implement the
Task IHandleEvent.HandleEventAsync(EventCallbackWorkItem item, object arg)
` public abstract class YourComponent : ComponentBase, IHandleEvent { [Inject] public BlazorSession Session { get; set; }
Task IHandleEvent.HandleEventAsync(EventCallbackWorkItem item, object arg)
{
return Session.HandleEventAsync(item, arg, delegate
{
StateHasChanged();
});
}
}
`
Thanks very much