private void WindowAddBakhshNameOnBakhshNameAdded(object sender, EventArgs eventArgs) { LoadComboBoxBakhshName(); foreach (Window window in Application.Current.Windows) { if (window.GetType() == typeof(WindowAddDastgahName)) { WindowAddDastgahName windowAddDastgahName = (WindowAddDastgahName)window; windowAddDastgahName.LoadComboBoxBakhshName(); } if (window.GetType() == typeof(WindowAdd)) { WindowAdd windowAdd = (WindowAdd)window; windowAdd.LoadComboBoxBakhshName(); } if (window.GetType() == typeof(WindowEdit)) { WindowEdit windowEdit = (WindowEdit)window; windowEdit.LoadComboBoxBakhshName(); } } }
void windowEditDastgahName_DastgahNameEdited(object sender, EventArgs e) { LoadComboBoxDastgahName(); foreach (Window window in Application.Current.Windows) { if (window.GetType() == typeof(WindowAdd)) { WindowAdd windowAdd = (WindowAdd)window; windowAdd.LoadComboBoxBakhshName(); windowAdd.LoadComboBoxdastgahName(); } if (window.GetType() == typeof(WindowEdit)) { WindowEdit windowEdit = (WindowEdit)window; windowEdit.LoadComboBoxBakhshName(); windowEdit.LoadComboBoxdastgahName(); } if (window.GetType() == typeof(MainWindow)) { MainWindow mainWindow = (MainWindow)window; mainWindow.LoadGridViewDarkhastha(); } } }