Hi,
I'm using DialogService.OpenAsync<T>()
to display a modal dialog in my Blazor + Radzen app. Inside the modal, the user performs an operation and then clicks a button that triggers a confirmation dialog (via a custom confirmation service).
If the user confirms the action, I then close the main modal using DialogService.Close(result)
.
To reload data after the modal is closed, I attach a handler to DialogService.OnClose
, and unsubscribe from it after it's triggered once.
problem: DialogService.OnClose` is being triggered when the confirmation dialog closes, not when the main modal dialog is closed. This causes my data reload logic to run too early. The actual modal remains open, but the event has already fired, and does not fire again when the modal is eventually closed.
Ineed a way to detect only the closing of the main modal dialog opened via OpenAsync<T>()
, and not any intermediate confirmation dialogs that may be used within it.
Is there a best practice for handling this situation?
Thanks!