Table of Contents

Interface ITwToastService

Namespace
TwBlazor.Services
Assembly
TwBlazor.dll

Service for managing toast notifications.

public interface ITwToastService : IDisposable
Inherited Members
Extension Methods

Properties

HasToasts

Gets whether there are any active toasts.

bool HasToasts { get; }

Property Value

bool

Methods

AddToast(ToastModel)

Adds a new toast notification.

void AddToast(ToastModel toast)

Parameters

toast ToastModel

The toast to add.

ClearAll()

Clears all active toasts.

void ClearAll()

ClearToast(ToastModel)

Removes a specific toast notification.

void ClearToast(ToastModel toast)

Parameters

toast ToastModel

The toast to remove.

GetToasts()

Gets the current list of active toasts.

List<ToastModel> GetToasts()

Returns

List<ToastModel>

List of active toast notifications.

PauseToastForFocus(Guid)

Marks a toast as having keyboard focus, pausing its auto-dismiss timer.

void PauseToastForFocus(Guid toastId)

Parameters

toastId Guid

The Id of the toast to pause.

Remarks

Hover and focus are tracked independently (see PauseToastForHover(Guid)) so that a toast still being hovered doesn't have its timer resumed just because keyboard focus left it.

PauseToastForHover(Guid)

Marks a toast as hovered by the pointer, pausing its auto-dismiss timer.

void PauseToastForHover(Guid toastId)

Parameters

toastId Guid

The Id of the toast to pause.

Remarks

Hover and focus are tracked independently (see PauseToastForFocus(Guid)) so that a toast which still has keyboard focus doesn't have its timer resumed just because the pointer moved away.

ResumeToastForFocus(Guid)

Marks a toast as no longer having keyboard focus, resuming its auto-dismiss timer only if the pointer also isn't currently hovering the toast.

void ResumeToastForFocus(Guid toastId)

Parameters

toastId Guid

The Id of the toast to resume.

ResumeToastForHover(Guid)

Marks a toast as no longer hovered by the pointer, resuming its auto-dismiss timer only if the toast also doesn't currently have keyboard focus.

void ResumeToastForHover(Guid toastId)

Parameters

toastId Guid

The Id of the toast to resume.

Events

ToasterChanged

Event raised when the toast collection changes.

event EventHandler? ToasterChanged

Event Type

EventHandler

ToasterTimerElapsed

Event raised when the clean-up timer elapses.

event EventHandler? ToasterTimerElapsed

Event Type

EventHandler