NotificationService (HTML Support + Event handler)

I've been using Radzen notification's lately and wondered if there's a way we could know if the User can acknowledge the message/alert.

For example, adding a HTML button in the Notification or detect if the user clicks the close button in the alert.

Before asking here I've tried HTML in the Detail property but no luck. And I think the alert close is javascript...

Any thoughts on this?

Thanks in advance

var dialogResult = await DialogService.OpenAsync($"Conditions", new Dictionary<string, object>() { {"myParam", myParam} }, new DialogOptions(){ Width = $"{500}px",Height = $"{400}px" });

use you own custom dialog and capture all events of controls on "MyView" component

will test this and I'll provide feedback.

So I assume the only way is to use a Dialog, is that correct?

May be other options, however I achieved this way to do some options on dialog window with own custom buttons. However default close button is still there to close dialog. We can use dialog operations to extend it further.

protected override void OnInitialized()
DialogService.OnOpen += Open;
DialogService.OnClose += Close;

void Open(string title, Type type, Dictionary<string, object> parameters, DialogOptions options)
    console.Log("Dialog opened");

void Close(dynamic result)
    console.Log($"Dialog closed with result: {result}");

For open and close events to capture

@qmmughal thank you very much! This is will help !

1 Like