views:

154

answers:

1

I am building a dashboard where I am iterating through a list of controls to render, and I need to initiate a general callback both after each control and after they are all completed. I was curious what the best way to handle this is. I can get the control specific callback fired off by placing myUserControlCallback(); in the user control itself. I'm just not sure how to run something like allControlsRendered();.
Any ideas?

A: 

If you know how many widgets there are you can put a counter inside myUserControlCallback() and count the invocations. When number of invocations reaches number of widgets you know that the current call is last and you can now call allControlsRendered().

Jakub Konecki