Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created September 23, 2015 21:53
Show Gist options
  • Save rightfold/d8e985272b37af3e6dba to your computer and use it in GitHub Desktop.
Save rightfold/d8e985272b37af3e6dba to your computer and use it in GitHub Desktop.
public class NotifyCollectionChangedEventArgs<T>
{
private readonly NotifyCollectionChangedEventArgs _args;
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedEventArgs args)
{
_args = args;
}
public IEnumerable<T> NewItems => _args.NewItems?.Cast<T>() ?? Enumerable.Empty<T>();
public int NewStartingIndex => _args.NewStartingIndex;
public IEnumerable<T> OldItems => _args.OldItems?.Cast<T>() ?? Enumerable.Empty<T>();
public int OldStartingIndex => _args.OldStartingIndex;
public NotifyCollectionChangedAction Action => _args.Action;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment