Class ToastService
- Namespace
- BlazOrbit.Components.Layout.Services
- Assembly
- BlazOrbit.dll
Default IToastService implementation registered by AddBlazOrbit().
public sealed class ToastService : IToastService
- Inheritance
-
objectToastService
- 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
toastIdGuid
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
toastIdGuid
Returns
- Task
ResumeAsync(Guid)
Resumes auto-dismiss for the toast identified by toastId.
public Task ResumeAsync(Guid toastId)
Parameters
toastIdGuid
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
builderAction<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
builderAction<RenderTreeBuilder>optionsToastOptions
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
optionsToastOptions
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
parametersIDictionary<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
parametersIDictionary<string, object>optionsToastOptions
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
contentRenderFragmentoptionsToastOptions
Returns
- Task
Events
OnChangeAsync
Raised whenever the active-toasts list changes; awaited sequentially.
public event Func<Task>? OnChangeAsync
Event Type
- Func<Task>