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(); } } }
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(); } } }
private void RibbonButtonEdit_Click(object sender, RoutedEventArgs e) { Darkhastha2 selectedItem = (Darkhastha2)GridViewDarkhastha.SelectedItem; var editQuery = from d in Entities.Darkhasthas where d.DarkhastGUID == selectedItem.DarkhastGuid select d; Darkhastha currentItem = editQuery.FirstOrDefault(); WindowEdit windowEdit = new WindowEdit(); windowEdit.Darkhast = currentItem; windowEdit.DarkhastEdited += new EventHandler(windowEdit_DarkhastEdited); windowEdit.Show(); }