The 'await' operator can only be used within an async lambda expression

前端 未结 1 1503
星月不相逢
星月不相逢 2020-11-30 06:58

I\'ve got a c# Windows Store app. I\'m trying to launch a MessageDialog when one of the command buttons inside another MessageDialog is clicked. Th

相关标签:
1条回答
  • 2020-11-30 07:47

    You must mark your lambda expression as async, like so:

    messageDialog.Commands.Add(new UICommand("No", async (command) =>
    {
        await showSaveDialog();
    }));
    
    0 讨论(0)
提交回复
热议问题