// 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);