|
|
|
@ -1,28 +0,0 @@
|
|
|
|
|
using Connected.Components;
|
|
|
|
|
using Connected.Models.Modal;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
|
|
|
|
namespace Connected.Services.Modal;
|
|
|
|
|
public class ModalDialogService
|
|
|
|
|
{
|
|
|
|
|
public event Action<string, RenderFragment, List<ModalButton>, ModalOptions> OnShow;
|
|
|
|
|
public event Action<ModalButton?> OnClose;
|
|
|
|
|
|
|
|
|
|
public void ShowDialog(string title, RenderFragment content, List<ModalButton> buttons, ModalOptions options)
|
|
|
|
|
{
|
|
|
|
|
OnShow?.Invoke(title, content, buttons, options);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ShowDialog(string title, MarkupString contentMarkup, List<ModalButton> buttons, ModalOptions options)
|
|
|
|
|
{
|
|
|
|
|
var content = new RenderFragment(x => x.AddContent(1, contentMarkup));
|
|
|
|
|
OnShow?.Invoke(title, content, buttons, options);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Close(ModalButton? button)
|
|
|
|
|
{
|
|
|
|
|
OnClose?.Invoke(button);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|