/// <summary> /// Executed when create new tag button is clicked. /// Adds an EvernoteTagItem to the collection and puts it in edit mode. /// </summary> void createBtn_Click(object sender, RoutedEventArgs e) { if (ItemsSource != null) { var used = SelectedTags.ToList(); AllTags.Clear(); AllTags.AddRange(_originalAllTags.Where(t => !used.Select(u => u.Id).Contains(t.Id)).ToList()); } if (AllTags.Count == 0) { return; } var newItem = CreateTagItem(new Tag()); newItem.IsEditing = true; AddTag(newItem); this.SelectedItem = newItem; this.IsEditing = true; }