private void MainWindow_Closing(object sender, CancelEventArgs e) { StopTask(); StartTaskButton.Focus(); //Ensure that the binding data are saved SaveIniConfig(IniConfigManager); }