private void TagControlFilterOnSelectedTagsChanged(TagControl sender, List<string> tags) { DeckPickerList.SetSelectedTags(tags); _config.SelectedTags = tags; WriteConfig(); }
private void TagControlFilterOnOperationChanged(TagControl sender, Operation operation) { _config.TagOperation = operation; DeckPickerList.SetTagOperation(operation); DeckPickerList.UpdateList(); }
private void TagControlOnDeleteTag(TagControl sender, string tag) { if (_deckList.AllTags.Contains(tag)) { _deckList.AllTags.Remove(tag); foreach (var deck in _deckList.DecksList) { if (deck.Tags.Contains(tag)) { deck.Tags.Remove(tag); } } if (_newDeck.Tags.Contains(tag)) _newDeck.Tags.Remove(tag); WriteDecks(); TagControlFilter.LoadTags(_deckList.AllTags); TagControlMyDecks.LoadTags(_deckList.AllTags.Where(t => t != "All").ToList()); TagControlNewDeck.LoadTags(_deckList.AllTags.Where(t => t != "All").ToList()); DeckPickerList.UpdateList(); } }
private void TagControlOnSelectedTagsChanged(TagControl sender, List<string> tags) { if (_newDeck == null) return; if (sender.Name == "TagControlNewDeck") BtnSaveDeck.Content = "Save*"; else if (sender.Name == "TagControlMyDecks") { var deck = DeckPickerList.SelectedDeck; deck.Tags = tags; DeckPickerList.UpdateList(); DeckPickerList.SelectDeck(deck); } }
private void TagControlOnNewTag(TagControl sender, string tag) { if (!_deckList.AllTags.Contains(tag)) { _deckList.AllTags.Add(tag); WriteDecks(); TagControlFilter.LoadTags(_deckList.AllTags); TagControlMyDecks.LoadTags(_deckList.AllTags.Where(t => t != "All").ToList()); TagControlNewDeck.LoadTags(_deckList.AllTags.Where(t => t != "All").ToList()); } }