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(); }); var onShowEventArgs = new OnShowEventArgs() { Title = title, Content = content, Parameters = parameters, Options = options, }; this.modalType = contentComponent; this.OnShow?.Invoke(this, onShowEventArgs); }
public void Show <T>(string title, ModalParameters parameters = null, ModalOptions options = null) where T : ComponentBase { this.Show(typeof(T), title, parameters, options); }
public void Show <T>(string title, ModalParameters parameters) where T : ComponentBase { this.Show <T>(title, parameters, new ModalOptions()); }