示例#1
0
		protected override void OnDataSourceReplaced(PointDataSourceBase oldDataSource, PointDataSourceBase newDataSource)
		{
			base.OnDataSourceReplaced(oldDataSource, newDataSource);

			DestroyUIRepresentation();
			CreateUIRepresentation();
		}
		private void RaiseDataSourceReplaced(PointDataSourceBase prevSource, PointDataSourceBase currSource)
		{
			DataSourceReplaced.Raise(this, prevSource, currSource);
		}
		protected virtual void OnDataSourceReplaced(PointDataSourceBase prevSource, PointDataSourceBase currSource)
		{
			if (prevSource != null)
			{
				prevSource.CollectionChanged -= OnDataSourceChanged;
				//prevSource.DataPrepaired -= DataSource_OnDataPrepaired;
			}
			if (currSource != null)
			{
				currSource.CollectionChanged += OnDataSourceChanged;
				//currSource.DataPrepaired += DataSource_OnDataPrepaired;

				//currSource.Filters.AddMany(filters);
			}

			RaiseDataSourceReplaced(prevSource, currSource);
		}
		protected void RaiseDataSourceChanged(PointDataSourceBase prevSource, PointDataSourceBase currSource)
		{
			DataSourceChanged.Raise(this, prevSource, currSource);
		}
		protected virtual void OnDataSourceReplaced(PointDataSourceBase oldDataSource, PointDataSourceBase newDataSource)
		{
			if (oldDataSource != null)
				oldDataSource.CollectionChanged -= OnDataSource_CollectionChanged;

			if (newDataSource != null)
				newDataSource.CollectionChanged += OnDataSource_CollectionChanged;
		}