/// <summary> /// CollectionChanged by the child in section /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">The ${ParameterType} instance containing the event data.</param> public void OnSectionCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.NewItems != null) { e.NewItems.Cast <Cell>().ForEach(cell => cell.Parent = this); } SectionCollectionChanged?.Invoke(sender, e); }
void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { var oldCells = e.OldItems?.OfType <CellBase>() ?? Enumerable.Empty <CellBase>(); foreach (var oldCell in oldCells) { oldCell.PropertyChanged -= OnItemPropertyChanged; } var newCells = e.NewItems?.OfType <CellBase>() ?? Enumerable.Empty <CellBase>(); foreach (var newCell in newCells) { newCell.PropertyChanged += OnItemPropertyChanged; } SectionCollectionChanged?.Invoke(this, e); }
private void ChildCollectionChanged(object sender, NotifyCollectionChangedEventArgs args) { SectionCollectionChanged?.Invoke(this, EventArgs.Empty); }
void ChildCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs) { SectionCollectionChanged?.Invoke(sender, notifyCollectionChangedEventArgs); }
void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { SectionCollectionChanged?.Invoke(this, e); }