Closed dirething closed 1 year ago
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?
This isn't a supported scenario and the show and hide events are for internal use only.
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:
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?