예제 #1
0
        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);
        }
예제 #2
0
 public void Show <T>(string title, ModalParameters parameters = null, ModalOptions options = null) where T : ComponentBase
 {
     Show(typeof(T), title, parameters, options);
 }
예제 #3
0
 public void Show <T>(string title, ModalParameters parameters) where T : ComponentBase
 {
     Show <T>(title, parameters, new ModalOptions());
 }