Closed uyaem closed 3 years ago
The problem is right here: ListCollectionView
doesn't allow Add events with ranges of added items. The options are therefore 1) raise multiple Add events, or 2) raise a Reset event. We do the latter: if the user wants multiple Add events, they can call BindableCollection.Add
multiple times themselves.
Ah, I was wondering why you didn't simply use the NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, IList, IList)
constructor. 😃
The implementation in ListCollectionView
seems silly/dated...
My BindableCollection
is initialized with multiple entries. my View contains both a DataGrid
for editing, as well as a "graph" which should reflect any data changes on the fly, therefore I need to attach PropertyChanged
listeners to all entries.
Seems like my "workaround" of using a loop with the BindableCollection.Add
in the initialization must therefore become a permanent thing.
Thanks for the clarification. 👍
When calling
BindableCollection.AddRange
, theCollectionChanged
event gets raised as expected, but the event handler'sNotifyCollectionChangedEventArgs.NewItems
is alwaysnull
.Expected behaviour: The added/removed items should be listed in
e.NewItems
/e.OldItems
, like when callingBindableCollection.Add(...)
.Affected version: Stylet 1.3.4