Current ChangeKind only supports Add, Remove, Move; would like to add Replace, Reset events.
ISynchronizedView event OnCollectionChanged comes from NotifyCollectionChangedEventArgs of the source collection, but it may not be sufficient.
NotifyCollectionChangedEventArgs indices may be different from the index of the view's collection
NotifyCollectionChangedEventArgs supports both single value/multiple value, which may be unwieldy for a public API.
So change parameters for SynchronizedView.OnCollectionChanged.
Support for receiving recalculated indexes
Support for receiving oldValue, etc.
Before:
void OnCollectionChanged(ChangedKind changedKind, T value, TView view, in NotifyCollectionChangedEventArgs<int> eventArgs);
After:
public readonly struct SynchronizedViewChangedEventArgs<T, TView>
{
public readonly NotifyCollectionChangedAction Action = action;
public readonly T NewValue = newValue;
public readonly T OldValue = oldValue;
public readonly TView NewView = newView;
public readonly TView OldView = oldView;
public readonly int NewViewIndex = newViewIndex;
public readonly int OldViewIndex = oldViewIndex;
}
void OnCollectionChanged(in SynchronizedViewChangedEventArgs<int, ViewModel> eventArgs);
What we would like to improve:
So change parameters for
SynchronizedView.OnCollectionChanged
.Before:
After: