Hello everyone.
I'm turning to you today to ask for help about RadzenNotifications in Blazor Server. I have a problem that I have tried to turn in all directions but I can't solve it.
Let me set the context here:
I have a BackgroundTask (.cs) that takes care of checking the connection with an external device and send alarms if needed (for exemple a connection lost). This one works correctly because the program manages well to send and receive e-mails about it and store it on the DB. This task uses a custom Service "MsaNotificationService" (.cs) to do this.
After that, I would like to use RadzenNotification to display this alarm directly on the web application screen (this is where I'm stuck). I have tried several methods but I will already present you the following one:
First of all, as the doc says, I added my services in Startup.cs :
I then added in MainLayout.razor as the doc says too.
So in background task i create my "MsaNotificationService" and when an problem is detected I call his method "SendEvent" that Notify an Action with the NotificationMessage :
The relatives event/methods :

Then, In my MainLayout.razor that inherits MainLayoutBase, i added this block of code to fire the previous event and use the NotificationService (I tried to do it directly in the MainLayoutBase too):
Unfortunatly when I invoke my OnAction on MsaNotificationService, the event is never fired... Does anyone know why ?
A second approach I used what to use "NotificationService" directly in "MsaNotificationService" by Dependency Injection and call the NotificationService.Notify(message) directly from my SendEvent() method :

I Used this CreateScope() method because i had ambiguous contructor errors if I used DI by parameters.
But this method has no effect, no pop-ups notification feedback are coming up.
As you can see, I am stuck on this problem. I have also tried other methods but without success. Do you have any idea how I could get that succed ?
Thank you very much in advance !




