//----------------------------------------------------- #region Construction public GroupData(object header) { this._header = header; _internalItems = new FastObservableCollection <object>(); Items = new ReadOnlyObservableCollection <object>(_internalItems); _level = 0; this.IsBottomLevel = true; }
//----------------------------------------------------- #region Construction public CollectionView(IList sourceCollection) { _sourceCollection = sourceCollection ?? throw new ArgumentNullException(nameof(sourceCollection)); _groups = new FastObservableCollection <IGroupData>(); Groups = new ReadOnlyObservableCollection <IGroupData>(_groups); _groupDescriptions = new FastObservableCollection <GroupDescription>(); GroupDescriptions.CollectionChanged += _groupDescriptions_CollectionChanged; _sortDescriptions = new FastObservableCollection <SortDescription>(); SortDescriptions.CollectionChanged += _sortDescriptions_CollectionChanged; var newObservable = _sourceCollection as INotifyCollectionChanged; if (newObservable != null) { _subscription = newObservable.WeakSubscribe(OnSourceCollection_CollectionChanged); } Init(); }