I am having with Radzen DialogBox.
Initial dialog box call:
var parameters = new Dictionary<string, object>
{
{"Transaction", Transaction_Model },
{"Payment", null },
{"Connection", conn },
{"SqlTransaction", transaction }
};
var dialogResult = await DialogService.OpenAsync<PaymentDialog>("Payment", parameters, new DialogOptions { Width = "1100px", Height = "700px", Draggable = true, Resizable = true });
I have below code inside dialog box:
@foreach (var item in templateData)
{
<RadzenButton class="product-remove-button" Icon="remove" Size="ButtonSize.Small" Click=@(() => RemoveTransactionItem(item))>β</RadzenButton>
</span>
<span class="quantity">@(item.Quantity) x</span>
<span class="product-name">
@{
@(item.Short_Name)
}
</span>
</div>
</div>
}
Then I have below confirmation dialog when user tries to remove. When I call confirmation inside dialog box the data is lost from the original dialog box. Means it resets the dialogbox state.
private async void RemoveTransactionItem(TransactionItemModel? transactionItem)
{
var dialogResult = await DialogService.Confirm(DialogMessages.Delete_Confirmation_Message.Message, DialogMessages.Delete_Confirmation_Message.Title, new ConfirmOptions() { OkButtonText = "Yes", CancelButtonText = "No" });
if (dialogResult == true)
{
}
}
