I have a method that is called after the initialization component, the method signature is like:
public async void method_name ()
{
// code ...
}
Inside that method, I have a loop running with 4 different if statements. I need the loop to pause at each if statements and wait for the user to press a button. Since pressing that button will add info and stuff. Once the button is pressed, I want the loop to continue and of course pause at the next if statements.
I thought about doing it like await Task.Delay(30000); but if the user is done entering the info before that timer is over, he/she will just be waiting. and That's not efficient.
async voidis meant for event handlers. You probably shouldn't be using it anywhere else.