protected virtual void ChangeForm(string formName) { if (_mContracte == null) _mContracte = UiFactory.GetUserControl("Contracte") as UcContracte; if (_mContracte != null) _mContracte.OnContractSaveEventHandler += CallBackFromContracte; if (UserControlChanging != null) { UserControlChanging(formName, new UserControlEventArgs {UsControlName = formName}); } //UserControlChanging?.Invoke(formName,new UserControlEventArgs() {UsControlName = this }); }
private void CallBackFromContracte(object sender, UserControlEventArgs arg) { FillCombobox(); ChangeForm(arg.UsControlName); if (_mContracte == null) return; _mContracte.OnContractSaveEventHandler -= CallBackFromContracte; _mContracte = null; }