Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 3
0
 private void CaptureEventHandlers()
 {
     if (InternalBag is IBindingList ibl)
     {
         ibl.ListChanged += (sender, e) => listChanged?.Invoke(this, e);
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 ///     Raises the ListChanged event.
 /// </summary>
 protected virtual void OnListChanged(ListChangedEventArgs e)
 {
     _onListChanged?.Invoke(this, e);
 }
Exemplo n.º 6
0
 /// <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(..);
 }