public void RemoveTab(int position = 0) { ItemSource.RemoveAt(position); if (position > 0) { _position = position - 1; } }
/// <summary> /// Invoked by the user to request deletion of an object at a specific index. /// </summary> /// <param name="index">The index in which the item will be removed.</param> protected virtual void Remove(int index) { var oldObj = ItemSource[index]; ItemSource.RemoveAt(index); if (ItemSource.Count == 0) { ItemSource = null; } if (!(ItemSource is INotifyCollectionChanged)) { HandleCollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, oldObj, index)); } }
void Delete_Clicked(object s, EventArgs a) { ItemSource.RemoveAt(IndexOf(a)); }