Today I tweaked the Event Aggregator Quickstart that comes with the Prism-v2 source code to show how Silverlight 3 Child Windows could be used in a Silverlight Composite Application.
Child Window Overview
Silverlight 3 has a new template called ChildWindow. It is basically a user control (unlike a Popup you can edit its XAML), but it allows you to create modal windows for your application, such as dialogs.
To use this dialog, you just have to create a new instance of it and call its Show method. As this call is asynchronic, you need to handle the Closed event to know when the dialog interaction has finished.
Sample Scenario
The Quickstart's scenario shows how to use the Event Aggregator to add funds of a particular customer, so what I did is add a confirmation dialog before adding the fund. After you select the customer and fund (both of them as in the original Quickstart) and click the Add button following dialog pops up:
As expected, if you click "Yes" the fund will be added, and if you click "No" or close the dialog it won't.
Child Window Sample
Disclaimer
This code is provided “AS IS” with no warranties, and confers no rights.
Download
You can get the sample from here: ChildWindowSample.zip.