namespace VberAdmin.Web.Models.Modals; public class VmModal { public VmModal(string id, string formId) { Id = id; FormId = formId; } public VmModal(string id) : this(id, id + "_form") { Id = id; } public VmModal() : this("modal", "form") { } public VmModalHeader Header { get; set; } public int? Footer { get; set; } = 0; private VmModalBody _body; public string Other { get; set; } public string Class { get; set; } public string SizeClass { get; set; } = "modal-lg"; public string DialogClass { get; set; } = "modal-dialog-centered modal-dialog-scrollable"; public int? Width { get; set; } public VmModalBody Body { get { _body.Modal = this; return _body; } set => _body = value; } public string Id { get; set; } public string FormId { get; set; } public VmModal WithOther(string other) { Other = other; return this; } public VmModal WithClass(string @class) { Class = @class; return this; } public VmModal WithSizeClass(string sizeClass, string @class) { SizeClass = sizeClass; Class = @class; return this; } public VmModal WithWidth(int width) { Width = width; return this; } public VmModal WithHeaderAndFooter(VmModalHeader header, int? footer = 0) { Header = header; Footer = footer; return this; } public VmModal WithHeaderAndFooter(string title, string preFix = null, string subFix = null, int? footer = 0) { Header = new VmModalHeader(title, preFix, subFix); Footer = footer; return this; } public VmModal WithBody(string body) { Body = new VmModalBody().WithBodyContent(body); return this; } public VmModal WithBody(VmModalTabBodyBase body) { Body = (VmModalBody)body; return this; } public VmModal WithBody(VmModalBody body) { Body = body; return this; } public VmModalBody WithBody() { Body = new VmModalBody(); return Body; } }