public void Toggle(T item) { var wasSelected = _selectedItems.Contains(item); if (wasSelected) { _selectedItems.Delete(item); } else { _selectedItems.InsertAt(0, item); } }
public static void Delete <T>(this IObservableCollection <T> self, IEnumerable <T> items) { self.Delete(items.ToArray()); }