I am using a window to change database configuration for my application. Settings button click is handeled by Config(), it show settings windows when clicked. If I close the
ConfigDialogBox configDlg = null; private void Config(object sender, RoutedEventArgs e) { configDlg = new ConfigDialogBox(); configDlg.Show(); configDlg.okButton.Click+=new RoutedEventHandler(SettingsChanged); configDlg.cancelButton.Click+=new RoutedEventHandler(SettingsChanged); }