The 'await' operator can only be used within an async lambda expression
问题 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. The point of this is to warn the user that their content is unsaved, and if they click cancel, it will prompt them to save using a separate save dialog. Here's my "showCloseDialog" function: private async Task showCloseDialog() { if (b_editedSinceSave) { var messageDialog = new MessageDialog("Unsaved work detected. Close anyway?", "Confirmation Message