leaderanalytics / MessageBox.Blazor

Simple, easy dialog box for Blazor applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leader Analytics

MessageBox.Blazor

An easy, simple dialog box for Blazor.

Demo

Getting Started

Install MudBlazor

Skip this step if you have already installed MudBlazor in your project. Otherwise, follow this documentation to install MudBlazor.

Install MessageBox.Blazor

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.

About

Simple, easy dialog box for Blazor applications

License:GNU Lesser General Public License v3.0


Languages

Language:HTML 51.5%Language:CSS 28.1%Language:C# 20.4%