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
You can't. Just create a new window.
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);
}
You can't reuse the window.
If closing the window via something other than OK and Cancel buttons is your problem, you need to handle the Window.Closing event (see the link for an example).