NotificationService Class

Class NotificationService. Contains various methods with options to open notifications. Should be added as scoped service in the application services and RadzenNotification should be added in application main layout.

Inheritance

Object

NotificationService

Namespace: Radzen

Assembly: Radzen.Blazor.dll

Syntax

public class NotificationService

Examples

@inject NotificationService NotificationService
<RadzenButton Text="Show info notification" Click=@(args => NotificationService.Notify(new NotificationMessage { Severity = NotificationSeverity.Info, Summary = "Info Summary", Detail = "Info Detail", Duration = 4000 })) / >

Constructors

NotificationServicelink

Class NotificationService. Contains various methods with options to open notifications. Should be added as scoped service in the application services and RadzenNotification should be added in application main layout.

Declaration
public NotificationService()

Properties

Messageslink

Gets the messages.

Declaration
public ObservableCollection<NotificationMessage> Messages { get; }
Property Value
Type Description
ObservableCollection<NotificationMessage>Gets the messages.

Methods

Notifylink

Notifies the specified message.

Declaration
public void Notify(NotificationMessage message)
Parameters
Type Name Description
NotificationMessage message The message.

Notifylink

Notifies the specified message.

Declaration
public void Notify(NotificationSeverity severity, string summary, string detail, TimeSpan duration, Action<NotificationMessage> click)
Parameters
Type Name Description
NotificationSeverity severity
string summary
string detail
TimeSpan duration
Action<NotificationMessage> click

Notifylink

Notifies the specified message.

Declaration
public void Notify(NotificationSeverity severity, string summary, string detail, double duration, Action<NotificationMessage> click, bool closeOnClick, object payload, Action<NotificationMessage> close)
Parameters
Type Name Description
NotificationSeverity severity
string summary
string detail
double duration
Action<NotificationMessage> click
bool closeOnClick
object payload
Action<NotificationMessage> close
An error has occurred. This app may no longer respond until reloaded. Reload 🗙