Why don't you use 'Close Event'?

Dec 8, 2009 at 7:48 PM

I think you can use 'Close Event' to do this.

 

Example:

 

 1 public MainPage()
 2         {
 3             InitializeComponent();
 4             childWindowDemo.Closed += new EventHandler(childWindowDemo_Closed);
 5         }
 6 
 7         private void childWindowDemo_Closed(object sender, EventArgs e)
 8         {
 9             bool? result = childWindowDemo.DialogResult;
10 
11             if (result.HasValue && result.Value)
12             {
13                 tbInfo.Text = childWindowDemo.TestString;
14             }
15         }
16 
17         private void childWindowDemo_OkClicked(object sender, EventArgs e)
18         {
19             tbInfo.Text = childWindowDemo.TestString;
20         }
21 
22         private void btPopup_Click(object sender, RoutedEventArgs e)
23         {
24             childWindowDemo.Show();

 

 

http://www.silverlightchina.net/html/tips/2009/1125/261.html