Thanks NDRA JITH,
You suggestion contains two methods, it would be nice if it's possible in one method, just like the confirm method in JavaScript. So open the Confirm dialog wait for the user to answer and based on the answer continue in the same method.
In Blazored it is possible (but I want it in Syncfusion) with the following code:
Parent screen:
@inject IModalService Modal
<BlazoredModal />
@code {
var modalImport = Modal.Show<ModalImport>("Title comes here");
var result = await modalImport.Result;
if (!result.Cancelled)
{
var doSomethingWithThisResult = result.Data;
}
}
Modal screen:
@inject IModalService ModalService;
<button @onclick="HandleStartImport" class="btn btn-secondary">Start</button>
<button @onclick="No" class="btn btn-secondary">Cancel</button>
@code {
[CascadingParameter] BlazoredModalInstance BlazoredModal { get; set; }
async Task HandleStartImport()
{
BlazoredModal.Close(ModalResult.Ok("I clicked OK!"));
}
void No() => BlazoredModal.Cancel();
}