Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class ExtensionMethods
- {
- public static int RemoveAll<T>(this ObservableCollection<T> coll, Func<T, bool> condition)
- {
- var itemsToRemove = coll.Where(condition).ToList();
- foreach (var itemToRemove in itemsToRemove)
- {
- coll.Remove(itemToRemove);
- }
- return itemsToRemove.Count;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement