Skip to content

Instantly share code, notes, and snippets.

@ichengzi
Created December 27, 2016 03:56
Show Gist options
  • Save ichengzi/f0a69167a9f49f06038f2a302b447522 to your computer and use it in GitHub Desktop.
Save ichengzi/f0a69167a9f49f06038f2a302b447522 to your computer and use it in GitHub Desktop.
Extensions
public static class Extensions
{
public static void AddRange<T>(this ObservableCollection<T> oc, IEnumerable<T> collection)
{
if (collection == null)
{
throw new ArgumentNullException("collection");
}
collection.ToList().ForEach( oc.Add);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment