Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class NotificationService

    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
    System.Object
    NotificationService
    Namespace: Radzen
    Assembly: Radzen.Blazor.dll
    Syntax
    public class NotificationService : object
    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 })) / >

    Properties

    Messages

    Gets the messages.

    Declaration
    public ObservableCollection<NotificationMessage> Messages { get; }
    Property Value
    Type Description
    ObservableCollection<NotificationMessage>

    The messages.

    Methods

    Notify(NotificationMessage)

    Notifies the specified message.

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

    The message.

    Notify(NotificationSeverity, String, String, Double, Action<NotificationMessage>, Boolean, Object, Action<NotificationMessage>)

    Notifies the specified severity.

    Declaration
    public void Notify(NotificationSeverity severity = NotificationSeverity.Info, string summary = "", string detail = "", double duration = null, Action<NotificationMessage> click = null, bool closeOnClick = false, object payload = null, Action<NotificationMessage> close = null)
    Parameters
    Type Name Description
    NotificationSeverity severity

    The severity.

    System.String summary

    The summary.

    System.String detail

    The detail.

    System.Double duration

    The duration, default of 3 seconds.

    Action<NotificationMessage> click

    The click event.

    System.Boolean closeOnClick

    If true, then the notification will be closed when clicked on.

    System.Object payload

    Used to store a custom payload that can be retreived later in the click event handler.

    Action<NotificationMessage> close

    Action to be executed on close.

    Notify(NotificationSeverity, String, String, TimeSpan, Action<NotificationMessage>)

    Notifies the specified severity.

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

    The severity.

    System.String summary

    The summary.

    System.String detail

    The detail.

    TimeSpan duration

    The duration.

    Action<NotificationMessage> click

    The click event.

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT