You must mark your lambda expression as async
, like so:
messageDialog.Commands.Add(new UICommand("No", async (command) =>
{
await showSaveDialog();
}));
More Related Contents:
- Is it possible to await an event instead of another async method?
- Synchronously waiting for an async operation, and why does Wait() freeze the program here
- Correct way to get the CoreDispatcher in a Windows Store app
- Task.Factory.StartNew with async lambda and Task.WaitAll
- RunAsync – How do I await the completion of work on the UI thread?
- Retrieving Property name from lambda expression
- Send values from one form to another form
- Can constructors be async?
- Await on a completed task same as task.Result?
- Using async-await on .net 4
- Async/await with/without awaiting (fire and forget)
- Why should I prefer single ‘await Task.WhenAll’ over multiple awaits?
- How can I get every nth item from a List?
- When should I use Async Controllers in ASP.NET MVC?
- How do I invoke an extension method using reflection?
- Get property name and type using lambda expression
- Asynchronous Task.WhenAll with timeout
- Async/Await vs Threads
- Async implementation of IValueConverter
- Revisiting Task.ConfigureAwait(continueOnCapturedContext: false)
- Brief explanation of Async/Await in .Net 4.5
- EF Data Context – Async/Await & Multithreading
- Why can’t c# use inline anonymous lambdas or delegates? [duplicate]
- How to access a Control inside the data template in C# Metro UI in the code behind
- How do you create an asynchronous method in C#?
- Max return value if empty query
- Cannot implicitly convert type from Task
- Faulted vs Canceled task status after CancellationToken.ThrowIfCancellationRequested
- Linq – Top value from each group
- Using async / await with DataReader ? ( without middle buffers!)