I have a child window in Silverlight and I wish to send a string value to populate a text box in the applications MainPage.xaml.
How can I pass the value back?
I have tried this –
MainPage m = (MainPage)Application.Current.RootVisual;
m.textBox1.Text = value;
You should do this the other way around. The parent that opens the child window should attach an event handler to an event of the child, for example:
Within this handler, the Parent can update its own Controls with values from properties of the child Window.