HxMessenger

HxToastContainer wrapper for displaying HxToast messages dispatched through IHxMessengerService.

Component is using IHxMessengerService injected service.

Informational messages are automatically hidden after 5 seconds, warning and error messages remain visible till manually closed.

Basic usage #

You should place the HxMessenger component itself to the layout component (MainLayout.razor) to make it work!

@inherits LayoutComponentBase

<HxMessenger Position="ToastContainerPosition.TopEnd" />

@Body

Call services.AddHxMessenger() in Startup.cs to setup related services.

public void ConfigureServices(IServiceCollection services)
{
	// ...
	services.AddHxMessenger();
	// ...
}

Clearing messages #

Use messenger.Clear() method (IHxMessengerService) if you want all messages to disappear immediately.

API

Parameters

Name Type Description
CssClass string Additional CSS class.
Position ToastContainerPosition Position of the messages. Default is ToastContainerPosition.None.
An unhandled error has occurred. Reload 🗙