private void DoQuery(QueryRequest request) { object data = null; Exception exception = null; try { data = request.DataProducer(); } catch (Exception e) { exception = e; } //if (!System.Windows.Application.Current.Dispatcher.CheckAccess()) // System.Windows.Application.Current.Dispatcher.Invoke( // new Action(() => { IsBusy = false; }), // new object[] { }); if (!this._endInitCompete && exception != null) { this._endInitError = true; } //如果没有取消,则继续通知更改。 if (request.Version == this._queryVersion) { //把结果返回到基类中。 this.OnQueryFinished(data, exception, o => { this.IsBusy = false; return(null); }, null); } }
private void DoQuery(QueryRequest request) { object data = null; Exception exception = null; try { data = request.DataProducer(); } catch (Exception e) { exception = e; } //if (!System.Windows.Application.Current.Dispatcher.CheckAccess()) // System.Windows.Application.Current.Dispatcher.Invoke( // new Action(() => { IsBusy = false; }), // new object[] { }); if (!this._endInitCompete && exception != null) this._endInitError = true; //如果没有取消,则继续通知更改。 if (request.Version == this._queryVersion) { //把结果返回到基类中。 this.OnQueryFinished(data, exception, o => { this.IsBusy = false; return null; }, null); } }