void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e) { CmdrIcon item = sender as CmdrIcon; if (item != null) { ModifiedItems.Add(item); } }
void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e) { IOrderItem item = sender as IOrderItem; if (item != null) { ModifiedItems.Add(item); } }
public async Task OnPostUpdateAsync(PostUpdateEvent @event, CancellationToken cancellationToken) { if (isActive == false) { return; } var modifiedItems = await(@event.Persister.FindModifiedAsync(@event.OldState, @event.State, @event.Entity, @event.Session, cancellationToken)); foreach (int index in modifiedItems) { ModifiedItems.Add(new Item { Index = index, OldState = @event.OldState[index], State = @event.State[index] }); } }
private void ItemObservableCollection_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (e.NewItems != null) { foreach (IOrderItem newItem in e.NewItems) { ModifiedItems.Add(newItem); //Add listener for each item on PropertyChanged event newItem.PropertyChanged += this.OnItemPropertyChanged; } } if (e.OldItems != null) { foreach (IOrderItem oldItem in e.OldItems) { ModifiedItems.Add(oldItem); oldItem.PropertyChanged -= this.OnItemPropertyChanged; } } }
void CmdrIconsChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.NewItems != null) { foreach (CmdrIcon newItem in e.NewItems) { ModifiedItems.Add(newItem); //Add listener for each item on PropertyChanged event newItem.PropertyChanged += this.OnItemPropertyChanged; } } if (e.OldItems != null) { foreach (CmdrIcon oldItem in e.OldItems) { ModifiedItems.Add(oldItem); oldItem.PropertyChanged -= this.OnItemPropertyChanged; } } }