So I have the following code (kinda) where I need to call MessageDialog.ShowAsync and wait for the result:
public object Execute()
{
var messageDialog = new MessageDialog("", "");
await messageDialog.ShowAsync();
}
but because Execute() is part of an Interface, I cannot change its signature to return a Task nor void. So the best I've come up with so far is this:
public object Execute()
{
var messageDialog = new MessageDialog("", "");
messageDialog.ShowAsync().AsTask().ContinueWith(c =>
{
// ...
});
}