public void ShowModal(string title, RenderFragment content, ModalParameters parameters) { Title = title; Content = content; Parameters = parameters; IsVisible = true; StateHasChanged(); }
public void Show(string title, Type componentType, ModalParameters parameters) { if (!typeof(ComponentBase).IsAssignableFrom(componentType)) { throw new ArgumentException($"{componentType.FullName} must be a Blazor Component"); } var content = new RenderFragment(x => { x.OpenComponent(1, componentType); x.CloseComponent(); }); OnShow?.Invoke(title, content, parameters); }