XamPivotGrid 12.1 Breaking Changes

Philip Atanassov / Wednesday, June 20, 2012

The 12.1 release brought a lot of cool new features for the XamPivotGrid. Some of them are Calculated Members, Custom Header and Cell Templates, Dynamic Metadata Tree, Lockable Components, Field Chooser and so on. In order to make all these improvements possible, improve performance and fix issues, some breaking changes took place. Below is the list of all breaking changes regarding the pivot grid and the data sources used with it.

DataSource Breaking Changes

1. The type of event arguments for IOlapViewModel.ResultChanged event changed to ResultChangedEventArgs.

2. DataSourceBase.BuildDataInternal(System.ComponentModel.BackgroundWorker, System.ComponentModel.DoWorkEventArgs) definition changed to

DataSourceBase.BuildDataInternal(DataSourceBase.BackgroundWorker, DataSourceBase.DoWorkEventArgs)

DataSourceBase.BackgroundWorker class definition is protected and this should minimize the possible conflicts, however if in your derived class you have overridden DataSourceBase.BuildDataInternal and you have also used System.ComponentModel.BackgroundWorker you might need to specify explicitly which worker type you point to.

Running this worker requires an instance of Work that the worker will work on and an instance of DataSourceState capturing the current state of the data source which is passed and can be accessed through DataSourceBase.DoWorkEventArgs.Argument. If you have DataSourceBase.BuildDataInternal overridden, now you can get with ease the information related to this worker’s current work.

3. When user’s application has a XamPivotDataSlicer which operates over given IHierarchy instance and an instance of IFilterViewModel over the same hierarchy instance is needed, the user’s code first should try to get the filter view model through DataSourceBase.GetFilterViewModelFromHierarchy(IHierarchy) instead of direct call to DataSourceBase.CreateFilterViewModel(IHierarchy):

// ensures that both the slicer and the filter tree are using 
// the same IFilterViewModel instance
IFilterViewModel filterViewModel = 
    dataSource.GetFilterViewModelFromHierarchy(hierarchy);
if (filterViewModel == null)
{
    filterViewModel = dataSource.CreateFilterViewModel(hierarchy);
}
 
// the filter tree will be synchronized with the 
// selection state of slicer’s items
dataSource.Rows.Add(filterViewModel);

 

XamPivotGrid Breaking Changes

1. In order to improve performance XamTree is replaced with XamDataTree. If you have customized the templates for the FilterFieldItemControl or XamDataSelector controls, or if your code anyhow depends on XamTree being used, make sure to replace the usage of XamTree with XamDataTree accordingly.