public bool Remove(T key) { if (_items.Contains(key)) { BeforeKeyRemoved?.Invoke(this, new KeyEventArg <T>(key)); } return(_items.Remove(key)); }
public bool Remove(TK key) { if (_items.ContainsKey(key)) { BeforeKeyRemoved?.Invoke(this, new KeyEventArg <TK>(key)); T item = (T)_items[key]; _items.Remove(key); item.PropertyChanged -= Value_PropertyChanged; return(true); } return(false); }