public bool Remove(IViewModelCollection <T> item) { var result = _sources.Remove(item); if (result) { Unwire(item); } return(result); }
private void Wire(IViewModelCollection <T> item) { if (_isOrdered) { item.CollectionChanged += OnCollectionSortedChanged; } else { item.CollectionChanged += OnCollectionChanged; } item.PropertyChanged += OnPropertyChanged; }
public void Add(IViewModelCollection <T> item) { _sources.Add(item); if (_isOrdered) { InternalAddSortedRange(item); } else { _items.AddRange(item); } Wire(item); }
public bool Contains(IViewModelCollection <T> item) { return(_sources.Contains(item)); }
private void Unwire(IViewModelCollection <T> item) { item.CollectionChanged -= OnCollectionChanged; }