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

Solution 1:

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

messageDialog.Commands.Add(new UICommand("No", async (command) =>
{
    await showSaveDialog();
}));