When creating the new “Create New Database” for the studio we ran into an issue with showing several child windows one after the other (and keeping in mind that if in one page cancel was click we don’t want to show the next windows) like an install wizard.
Unfortunately Silverlight does not have anything like that so we needed to create on for ourselves.
First thing we had in mind when we came to approach this is that Silverlight works asynchronously which means that we want to wait for a page to close before we open the next one.
The way we dealt with that was listening to every windows Closed event and on close open the next page (if exists) the Wizard class looks like this:
The ShowNext() method will check to see if we have more windows to show and show the next one or return with the result if we are done.
We use a TaskCompletionSource and the TPL to make sure that all of that is wrapped in a nice Task, and that is pretty much it. With that done, we can start using it. You can see how easy it is here: