private void CurrencyService_CurrentChanged(object sender, EventArgs e) { if (!this.isCurrentItemSynchronizing) { IDataSourceCurrency dsc = this.CurrentDataProvider.DataView as IDataSourceCurrency; if (dsc != null) { dsc.ChangeCurrentItem(this.View.CurrencyService.CurrentItem); } } }
protected void RefreshInternalView(bool resetStatus) { if (this.DataView != null) { if (this.DataView.BatchDataProvider != null) { this.DataView.BatchDataProvider.StatusChanged -= this.BatchProvider_StatusChanged; this.DataView.BatchDataProvider.Dispose(); } this.DataView.CollectionChanged -= this.DataView_CollectionChanged; this.DataView.CollectionChanging -= this.DataView_CollectionChanging; this.DataView.ItemPropertyChanged -= this.DataView_ItemPropertyChanged; IDataSourceCurrency dataViewCurrency = this.DataView as IDataSourceCurrency; if (dataViewCurrency != null) { dataViewCurrency.CurrentChanged -= this.DataView_CurrentChanged; } this.DataView.Dispose(); } if (resetStatus) { this.ResetStatus(); } this.DataView = DataSourceViewFacotry.CreateDataSourceView(this.ItemsSource ?? Enumerable.Empty <object>()); if (this.DataView.BatchDataProvider != null) { this.DataView.BatchDataProvider.StatusChanged += this.BatchProvider_StatusChanged; } this.DataView.CollectionChanged += this.DataView_CollectionChanged; this.DataView.CollectionChanging += this.DataView_CollectionChanging; this.DataView.ItemPropertyChanged += this.DataView_ItemPropertyChanged; IDataSourceCurrency dsc = this.DataView as IDataSourceCurrency; if (dsc != null) { dsc.CurrentChanged += this.DataView_CurrentChanged; } }