How to block until an event is fired in c#
If the current method is async then you can use TaskCompletionSource. Create a field that the event handler and the current method can access. This example uses a form that has a textblock named WelcomeTitle and two buttons. When the first button is clicked it starts the click event but stops at the await line. … Read more