-
-
Notifications
You must be signed in to change notification settings - Fork 190
Open
Labels
BugSomething isn't workingSomething isn't workingTriageIssue needs to be triagedIssue needs to be triaged
Description
Describe the bug
When I load the modal, the events you would expect fire. such as code behind SetParametersAsync, OnInitialized ,OnParametersSet and the linked viewmodel to fire the construct
When i close the modal, it fired them all again, have you even seen this issue please ?, we have just upgraded to .net8 Blazor Server
I call the modal with
var returnFilterData =
await _dialogManager.OpenInterfaceAsModalAsync<IGridFilterEditor_View, GridFilterEditor_Output>("", inputs);
public async Task<O> OpenInterfaceAsModalAsync<T, O>(string title = null, IEnumerable<KeyValuePair<string, object>> inputs = null)
{
var concreteImplementation = _serviceProvider.GetService<T>();
var concreteType = concreteImplementation.GetType();
return await OpenAsModalAsync<O>(concreteType, title, inputs);
}
public async Task<O> OpenAsModalAsync<O>(Type viewFragmentType, string title = null, IEnumerable<KeyValuePair<string, object>> inputs = null)
{
if (inputs == null)
inputs = new List<KeyValuePair<string, object>>();
// Params
var mp = new ModalParameters();
mp.Add("ViewFragmentType", viewFragmentType);
mp.Add("Inputs", inputs);
// Options
var mo = new ModalOptions { DisableBackgroundCancel = true, Position = ModalPosition.Middle , UseCustomLayout = true };
// Open the form
var modalForm = _modalService.Show<ModalHost_View>(title, mp, mo);
var modalResult = await modalForm.Result;
if (!(modalResult?.Confirmed ?? false)) return default;
if (modalResult.Data == null) return default;
if (modalResult.Data is not O) return default;
return (O)modalResult.Data;
}
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingTriageIssue needs to be triagedIssue needs to be triaged