using Yw.WinFrmUI; namespace PBS.WinFrmUI { public partial class AddFacilityDlg : DevExpress.XtraEditors.XtraForm { public AddFacilityDlg() { InitializeComponent(); this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; } public event Func> ReloadDataEvent; public async void SetBindingData() { await this.facilitiesCtrl.SetBindingData(); } /// /// 确定 /// private async void GeneralOkAndCancelCtrl1_OkEvent() { var vmo = this.facilitiesCtrl.GetData(); if (vmo == null) return; if (await ReloadDataEvent.Invoke(vmo)) { TipFormHelper.ShowSucceed("新增成功!"); } else { TipFormHelper.ShowError("新增失败!"); } this.Close(); } } }