public void Show(Type contentComponent, string title, ModalParameters parameters, ModalOptions options) { if (!typeof(ComponentBase).IsAssignableFrom(contentComponent)) { throw new ArgumentException("Must be a blazor component"); } var content = new RenderFragment(x => { x.OpenComponent(1, contentComponent); x.CloseComponent(); }); m_modalType = contentComponent; OnShow?.Invoke(title, content, parameters, options); }
public void Show <T>(string title, ModalParameters parameters = null, ModalOptions options = null) where T : ComponentBase { Show(typeof(T), title, parameters, options); }
public void Show <T>(string title, ModalParameters parameters) where T : ComponentBase { Show <T>(title, parameters, new ModalOptions()); }