public void Invalidate(int index) { if (change != null && index >= 0 && index < Count) { change.Invoke(this, new ListChangedEventArgs(ListChangedType.ItemChanged, index)); } }
private void CaptureEventHandlers() { if (WrappedSet is IBindingList ibl) { ibl.ListChanged += (sender, e) => listChanged?.Invoke(this, e); } }
private void CaptureEventHandlers() { if (InternalBag is IBindingList ibl) { ibl.ListChanged += (sender, e) => listChanged?.Invoke(this, e); } }
private void CaptureEventHandlers() { if (WrappedList is IBindingList ibl) { ibl.ListChanged += (sender, e) => listChanged?.Invoke(this, e); } if (WrappedList is INotifyCollectionChanged ncc) { ncc.CollectionChanged += (sender, e) => collectionChanged?.Invoke(this, e); } if (WrappedList is INotifyPropertyChanged npc) { npc.PropertyChanged += (sender, e) => propertyChanged?.Invoke(this, e); } }
/// <summary> /// Raises the ListChanged event. /// </summary> protected virtual void OnListChanged(ListChangedEventArgs e) { _onListChanged?.Invoke(this, e); }
/// <summary> /// Add a single item to the list and notify /// </summary> /// <param name="item">Item to add</param> public void Add(T item) { List.Add(item); onListChanged?.Invoke(this, resetEvent); // same as: if (onListChanged != null) onListChanged.Invoke(..); }