I am trying to open a dialog in mudblazor, but it seems the execution does not wait for it to close. In this case, the computer will beep while the dialog is still open. Why?
razor:
@inject IDialogService Dialog
code behind:
private async Task ChangeAvatar()
{
var result = await Dialog.ShowAsync<DlgAvatarSelection>("Select avatar",
new DialogOptions { CloseButton = true, CloseOnEscapeKey = true });
Console.Beep(1000, 25);
}
I am trying to open a dialog in mudblazor, but it seems the execution does not wait for it to close. In this case, the computer will beep while the dialog is still open. Why?
razor:
@inject IDialogService Dialog
code behind:
private async Task ChangeAvatar()
{
var result = await Dialog.ShowAsync<DlgAvatarSelection>("Select avatar",
new DialogOptions { CloseButton = true, CloseOnEscapeKey = true });
Console.Beep(1000, 25);
}
Share
Improve this question
edited Feb 11 at 13:36
DarkBee
15.5k8 gold badges72 silver badges118 bronze badges
asked Feb 11 at 13:03
Anders LindénAnders Lindén
7,35213 gold badges60 silver badges121 bronze badges
1 Answer
Reset to default 1Found it, I have to use Show and await the results Result.
var dlg = Dialog.Show<DlgAvatarSelection>("Select avatar");
var result = await dlg.Result;
var data = result.Data;
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745209752a4616764.html
评论列表(0条)