mudblazor - How to open dialog in modal fashion? - Stack Overflow

I am trying to open a dialog in mudblazor, but it seems the execution does not wait for it to close. In

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
Add a comment  | 

1 Answer 1

Reset to default 1

Found 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

相关推荐

  • mudblazor - How to open dialog in modal fashion? - Stack Overflow

    I am trying to open a dialog in mudblazor, but it seems the execution does not wait for it to close. In

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信