features/rewrite/modal1 #10

Merged
koma merged 18 commits from features/rewrite/modal1 into features/rewrite/main 2023-02-27 12:44:21 +00:00
3 changed files with 0 additions and 49 deletions
Showing only changes of commit a4d1f798f4 - Show all commits

View File

@ -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);
}
}

View File

@ -1,12 +0,0 @@
namespace Connected.Services.Modal;
public class Event
{
public Delegate Delegate;
public object[] args;
public Event(Delegate Delegate, object[] Args)
{
this.Delegate = Delegate;
this.args = Args;
}
}

View File

@ -1,9 +0,0 @@
namespace Connected.Services.Modal;
public class ModalOptions
{
public bool CloseOnEscKey { get; set; } = true;
public bool DisableBackdropCLick { get; set; } = false;
public bool NoHeader { get; set; } = false;
}