Table of Contents

Class ToastService

Namespace
BlazOrbit.Components.Layout.Services
Assembly
BlazOrbit.dll

Default IToastService implementation registered by AddBlazOrbit().

public sealed class ToastService : IToastService
Inheritance
object
ToastService
Implements

Constructors

ToastService()

public ToastService()

Properties

ActiveToasts

Currently active toasts.

public IReadOnlyList<ToastState> ActiveToasts { get; }

Property Value

IReadOnlyList<ToastState>

Count

Number of currently active toasts.

public int Count { get; }

Property Value

int

Methods

CloseAllAsync()

Closes every active toast.

public Task CloseAllAsync()

Returns

Task

CloseAsync(Guid)

Closes the toast identified by toastId.

public Task CloseAsync(Guid toastId)

Parameters

toastId Guid

Returns

Task

Dispose()

Cancels every pending dismiss timer and releases bookkeeping.

public void Dispose()

PauseAsync(Guid)

Pauses auto-dismiss for the toast identified by toastId.

public Task PauseAsync(Guid toastId)

Parameters

toastId Guid

Returns

Task

ResumeAsync(Guid)

Resumes auto-dismiss for the toast identified by toastId.

public Task ResumeAsync(Guid toastId)

Parameters

toastId Guid

Returns

Task

ShowAsync(Action<RenderTreeBuilder>)

Shows a toast whose body is built by the supplied render-tree builder action.

public Task ShowAsync(Action<RenderTreeBuilder> builder)

Parameters

builder Action<RenderTreeBuilder>

Returns

Task

ShowAsync(Action<RenderTreeBuilder>, ToastOptions?)

Shows a toast whose body is built by the supplied builder, with explicit options.

public Task ShowAsync(Action<RenderTreeBuilder> builder, ToastOptions? options)

Parameters

builder Action<RenderTreeBuilder>
options ToastOptions

Returns

Task

ShowAsync<TComponent>()

Shows a toast that renders TComponent.

public Task ShowAsync<TComponent>() where TComponent : IComponent

Returns

Task

Type Parameters

TComponent

ShowAsync<TComponent>(ToastOptions?)

Shows a toast that renders TComponent with explicit options.

public Task ShowAsync<TComponent>(ToastOptions? options) where TComponent : IComponent

Parameters

options ToastOptions

Returns

Task

Type Parameters

TComponent

ShowAsync<TComponent>(IDictionary<string, object?>?)

Shows a toast that renders TComponent with the given parameters.

public Task ShowAsync<TComponent>(IDictionary<string, object?>? parameters) where TComponent : IComponent

Parameters

parameters IDictionary<string, object>

Returns

Task

Type Parameters

TComponent

ShowAsync<TComponent>(IDictionary<string, object?>?, ToastOptions?)

Shows a toast that renders TComponent with parameters and explicit options.

public Task ShowAsync<TComponent>(IDictionary<string, object?>? parameters, ToastOptions? options) where TComponent : IComponent

Parameters

parameters IDictionary<string, object>
options ToastOptions

Returns

Task

Type Parameters

TComponent

ShowFragmentAsync(RenderFragment, ToastOptions?)

Shows a toast whose body is the supplied Microsoft.AspNetCore.Components.RenderFragment.

public Task ShowFragmentAsync(RenderFragment content, ToastOptions? options = null)

Parameters

content RenderFragment
options ToastOptions

Returns

Task

Events

OnChangeAsync

Raised whenever the active-toasts list changes; awaited sequentially.

public event Func<Task>? OnChangeAsync

Event Type

Func<Task>