protected override void PerformDrillDown(IEnumerable <object> itemsSource) { if (Current != null) { var currentGroup = Current as CollectionViewGroup; History.Push( new DrillDownHistory() { DrillDownPath = _drillDownPathQueue.ToArray(), Name = currentGroup != null ? currentGroup.Name.ToString() : (Current as CollectionViewWrapper).Name, Path = _currentPath, Parent = Parent, View = Current, } ); } Parent = Current; var view = CollectionViewSource.GetDefaultView(itemsSource); view.GroupDescriptions.Add(new PropertyGroupDescription(_currentPath)); Current = new CollectionViewWrapper { View = view }; ChartView = view.Groups.ToList(); DrillDownLevel++; }
public override void Refresh() { DrillDownLevel = 0; History = new Stack <DrillDownHistory>(); _drillDownPathQueue = new Queue <string>(DrillDownPath.Split(',')); GroupNames = _drillDownPathQueue.Count > 1 ? DrillDownPath.Split(',').ToList() : GroupNames; var view = CollectionViewSource.GetDefaultView(SourceCollection); view.GroupDescriptions.Clear(); foreach (var path in _drillDownPathQueue) { view.GroupDescriptions.Add(new PropertyGroupDescription(path)); } _currentPath = _drillDownPathQueue.Dequeue(); Current = new CollectionViewWrapper { Name = GroupNames[0], View = view }; ChartView = view.Groups.ToList(); OnAfterDrill(_currentPath, DrillDownLevel, true); }