I have a dialog which is invoked from a grid, and the goal is upon changing any value in the dialog update the grid. For that I can use an EventCallback. How can I pass a handler to the dialog’s EventCallback parameter?
Hey @ylr-research,
Check my answer in your other thread. Do not open duplicate threads or we will have no other option but discontinue your account.
There was no intention to create a duplicate thread. This is a consequence of you closing it. Hence, I had no other choice but to create it again. As to the answer in the other thread you suggested no callback is needed since the Dialog is awaited. Can you elaborate more on how that can help me?
I’ll repeat once again what I already posted in your other thread. Callbacks are used in the old days to get result of some async operation, now since we have async/await there is no need of callbacks. DialogService OpenAsync() method is awaitable - again check our demos for reference.
For some reason, after I edit the model passed in as a parameter to the dialog, if I add a breakpoint after the awaitable call, I see the model has none of the changes applied. Is there a reason for that?
Assuming the example below, say there is component to change the orderId. For example, change it to 10249. After I close the dialog the orderId remains 10248.
int orderID = 10248;
public async Task OpenOrder()
{
await DialogService.OpenAsync<DialogCardPage>($"Order {orderID}",
new Dictionary<string, object>() { { "OrderID", orderID } },
new DialogOptions() { Width = "700px", Height = "512px", Resizable = true, Draggable = true });
}
nvm, I just realized the result is dynamic. I can just send whatever I want. This can be closed.
Do you have a code example of your final solution.
did you assign the dialog result?
[see]
Yes, I was able to figure it out. Thanks!