features/rewrite/modal1 #10
@ -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);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -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;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -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;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user