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