示例#1
0
        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));
            }
        }
示例#3
0
 void Delete_Clicked(object s, EventArgs a)
 {
     ItemSource.RemoveAt(IndexOf(a));
 }