Search code examples
silverlightcounterchildwindow

Silverlight Open Child Window counter


I have a silverlight application which uses a child window as a processing dialog. The child window open can be called from more that one event.

What I would like to do is to add a counter to the Child Window Show() that increments by one on each call. That way, I should then be able to only call the Close() if the counter is at zero. This would allow for all the completed events to run and call a Close() and decrement the value by one with each call.

To be honest I'm not sure where to start with this one but any help or guidance would be great.

Thanks


Solution

  • Its not 100% clear what you are trying to accomplish, but a good way to retrieve all your opened childwindow objects is the following method :

    VisualTreeHelper.GetOpenPopups()
    

    Note that this is available since Silverlight version 4.0 only

    Good luck.