How to await an event click [duplicate]
问题 This question already has answers here : Is it possible to await an event instead of another async method? (9 answers) Closed 2 months ago . I'm trying to await a callback that is fired when a button is pressed. The important point is that I want to wait for the callback from a simple await without reshaping the code. In other words I want to achieve the following: internal async Task BatchLogic() { ProgressMessage = "Batch Logic Starts"; await OnCallbackFired(); ProgressMessage = "Batch