If I have an asynchronous method with a callback
MyMethodAsync( <Input Parameters ...>, Callback);
how can I make it awaitable?
[This method is for windows phone 7, but should be equally applicable to any similar c# construct]
DNSEndpoint Endpoint = ...
NameResolutionCallback Callback = (nrr) => { ... }
DeviceNetworkInformation.ResolveHostNameAsync(Enpoint, Callback, null);
I want to put an awaitable wrapper around this call, so I wait for the callback to complete before continuing with the next command.