views:

32

answers:

1
A: 

Don't use a ref. Just set the settings as a public property on the window

public class SettingsEditor : Window
{ 
  public XmlElement Settings {get;set;}
  /*...*/
}

Within the Window, update the settings and such as you've done. Once the window has been shown, get the settings out.

/*...*/
var editor = new SettingsEditor { Settings = settings };
editor.ShowDialog();
settings = editor.Settings;
/*...*/

You can also set a DialogResult on your window to see what happened with the editor...

Will