I have some code as below:
foreach (var position in mAllPositions)
{
DoAsyncCall(position);
}
//I want to execute co
Another option is to increase a counter in the foreach loop that calls the async processes. Then in the callback check you will decrement the counter and check for equality to zero. When the counter has returned to zero all calls are complete and your next code can run. Just be sure that you change the counter in a thread safe manner. The easiest way to do this might be to return to the UI thread before you decrement and test the counter.