An easy, simple dialog box for Blazor.
Skip this step if you have already installed MudBlazor in your project. Otherwise, follow this documentation to install MudBlazor.
Install the nuget package:
dotnet add package LeaderAnalytics.MessageBox.Blazor
Add LeaderAnalytics.MessageBox.Blazor to _Imports.razor:
@using LeaderAnalytics.MessageBox.Blazor
Add Service registration in Program.cs
:
using LeaderAnalytics.MessageBox.Blazor;
builder.Services.AddMessageBoxBlazor();
Add MessageBoxProvider
to MainLayout.razor
:
<MessageBoxProvider />
Inject IMessageBox
into your component:
[Inject] protected IMessageBox MessageBox { get; set; }
Call MessageBox
:
private async Task Button_Click() => await MessageBox.Info("Hello from MessageBox!");
This project takes a dependency on MudBlazor. Beyond that, it is not affiliated with, endorsed or supported by MudBlazor.