Toast icon indicating copy to clipboard operation
Toast copied to clipboard

[Question] is there something like a global Toast.OnShowComponent event?

Open dirething opened this issue 3 years ago • 0 comments

I had kind of taken a guess that if I went into the mainlayout where I have:

<BlazoredToasts Position="ToastPosition.BottomRight" MaxToastCount="3" Timeout="10" IconType="IconType.FontAwesome" SuccessClass="success-toast-override" SuccessIcon="fa fa-thumbs-up" />

and added something like the following to the code behind:

        protected override void OnAfterRender(bool firstRender)
        { Toast.OnShowComponent += Toast_OnShowComponent; }

that the Toast_OnShowComponent would get called by any toast on any page.

I think I understand now why that is wrong, but it does work for toasts issued from that page.

Is there a way to do this that I am missing?

dirething avatar Dec 08 '21 23:12 dirething