System.Windows.Data.ListCollectionView.CancelNew C# (CSharp) Method

CancelNew() public method

public CancelNew ( ) : void
return void
		public override void CancelNew ()
		{
			if (IsEditingItem)
				throw new InvalidOperationException ("Cannot CancelNew while editing an item");

			if (IsAddingNew) {
				if (CurrentAddItem is IEditableObject)
					((IEditableObject) CurrentAddItem).CancelEdit ();
				if (Grouping) {
					RootGroup.RemoveItem (CurrentAddItem);
				}
				RemoveFromSourceCollection (SourceCollection.IndexOf (CurrentAddItem));
				CurrentAddItem = null;
				IsAddingNew = false;
				UpdateCanAddNewAndRemove ();
			}
		}