Track Tooltips, Popover, Modal, OffCanvas in service.
Modal, Offcanvas backdrop should only show on first open.
Add Dynamic rendering for Tooltips, Popover, Modal, OffCanvas
In each toggle on ShowAsync we need to prerender the component before it continues the show method for animations and remove it after hidden
Example Goal
Modal.cs
public class Modal
{
public ConcurrentDictionary<string, dynamicType<object>> Children = new();
public BSModal Add<T>(Action<T> params, string id= Guid.NewGuid.ToString()) where T : class, new()
{
var result = new T();
T parameters;
params.Invoke(parameters);
result.Fragment = // Build component match attribute for parameters
if(!Children .TryAdd(id, result, out _)
{
throw("Blah");
}
return parameters.ObjectReferance;
}
public void Remove<T>(T blah)
{
// Remove
}
public void Remove<T>(string name)
{
// Remove
}
[JSInvokable]
public override async Task InteropEventCallback(string id, CallerName name, EventType type,
Dictionary<string, string>? classList, JavascriptEvent? e)
{
//loop children see if event is related do actions
}
}
Example Goal
Modal.cs
MainLayout
Any other component
ModalComponent.razor
ModalComponent.razor.cs