protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { //if (boolOkayPressed == false) { // ComboBoxPair cbp = new ComboBoxPair("",""); // SelectedComboBoxPair = cbp; //} //foreach (System.Windows.Window win in System.Windows.Application.Current.Windows) { // string name = win.Name; Methods myActions = new Methods(); myActions.SetValueByKeyGlobal("WindowTop", this.Top.ToString()); myActions.SetValueByKeyGlobal("WindowLeft", this.Left.ToString()); //} base.OnClosing(e); }