Class ModalService
- Namespace
- BlazOrbit.Components.Layout.Services
- Assembly
- BlazOrbit.dll
Default IModalService implementation registered by AddBlazOrbit().
public sealed class ModalService : IModalService
- Inheritance
-
objectModalService
- Implements
Constructors
ModalService()
public ModalService()
Properties
ActiveModals
Currently open modals, in stacking order (last is topmost).
public IReadOnlyList<ModalState> ActiveModals { get; }
Property Value
- IReadOnlyList<ModalState>
Methods
CloseAllAsync()
Closes every active modal in reverse order.
public Task CloseAllAsync()
Returns
- Task
CloseAsync()
Closes the topmost modal.
public Task CloseAsync()
Returns
- Task
ShowDialogAsync<TComponent>(object?, DialogOptions?)
Opens a dialog without awaiting a result.
public Task ShowDialogAsync<TComponent>(object? parameters = null, DialogOptions? options = null) where TComponent : IModalContent
Parameters
parametersobjectoptionsDialogOptions
Returns
- Task
Type Parameters
TComponent
ShowDialogAsync<TComponent, TResult>(object?, DialogOptions?)
Opens a dialog and awaits a typed result.
public Task<TResult?> ShowDialogAsync<TComponent, TResult>(object? parameters = null, DialogOptions? options = null) where TComponent : IModalContent
Parameters
parametersobjectoptionsDialogOptions
Returns
- Task<TResult>
Type Parameters
TComponentTResult
ShowDrawerAsync<TComponent>(object?, DrawerOptions?)
Opens a drawer without awaiting a result.
public Task ShowDrawerAsync<TComponent>(object? parameters = null, DrawerOptions? options = null) where TComponent : IModalContent
Parameters
parametersobjectoptionsDrawerOptions
Returns
- Task
Type Parameters
TComponent
ShowDrawerAsync<TComponent, TResult>(object?, DrawerOptions?)
Opens a drawer and awaits a typed result.
public Task<TResult?> ShowDrawerAsync<TComponent, TResult>(object? parameters = null, DrawerOptions? options = null) where TComponent : IModalContent
Parameters
parametersobjectoptionsDrawerOptions
Returns
- Task<TResult>
Type Parameters
TComponentTResult
Events
OnChangeAsync
Raised whenever the active-modals list changes; awaited sequentially.
public event Func<Task>? OnChangeAsync
Event Type
- Func<Task>