Why is calling await completing the parent Task prematurely?
I'm trying to create a control that exposes a DoLoading event that consumers can subscribe to in order to perform loading operations. For convenience, event handlers should be called from the UI thread allowing consumers to update the UI at will, but they will also be able to use async/await to perform long-running tasks without blocking the UI thread. For this, I have declared the following delegate: public delegate Task AsyncEventHandler<TEventArgs>(object sender, TEventArgs e); That allows consumers to subscribe to the event: public event AsyncEventHandler<bool> DoLoading; The idea is that