private void CancelEdit() { if (ItemsView.IsEditingItem) { ItemsView.CancelEdit(); } else if (ItemsView.IsAddingNew) { ItemsView.CancelNew(); } }