WinUI3中依次运行多个ContentDialog报错的问题咨询
WinUI3中依次运行多个ContentDialog报错的问题咨询
各位好,我在WinUI3开发时碰到个问题:我想让几个ContentDialog按顺序依次弹出,于是写了下面这段代码:
await App.GetService<IFirstRunDisplayService>().ShowIfAppropriateAsync(App.AppXamlRoot); await WhatsNewDisplayService.ShowIfAppropriateAsync(App.AppXamlRoot);
结果运行后直接报错了,错误信息如下:
System.Runtime.InteropServices.COMException: 'An async operation was not properly started.
Only a single ContentDialog can be open at any time.'
有没有朋友能帮忙看看怎么解决呀?我就想实现对话框逐个弹出的效果,不想让它们同时触发导致冲突。
备注:内容来源于stack exchange,提问作者bondarukid
相关产品推荐
相关产品推荐

