/// <summary> /// Collapses all groups of the ListView and backing the data up. /// </summary> public void CollapseAllGroups() { SearchText = ""; foreach (var taxonGroup in SelectedTaxonList) { foreach (var taxon in taxonGroup) { SelectedTaxonListSource.Remove(taxon); HiddenTaxonList.Add(taxon); } } AddListsToGroups(SelectedTaxonListSource); }
public void ToggleGroupingByOrderName(string orderName) { List <Taxon> tempTBDTaxa = new List <Taxon>(); bool foundInSelected = false; foreach (var taxonGroup in SelectedTaxonList) { foreach (var taxon in taxonGroup) { if (taxon.OrderName == orderName) { foundInSelected = true; } HiddenTaxonList.Add(taxon); } } SelectedTaxonListSource.Clear(); if (!foundInSelected) { foreach (var taxon in HiddenTaxonList) { if (taxon.OrderName == orderName) { SelectedTaxonListSource.Add(taxon); tempTBDTaxa.Add(taxon); } } foreach (Taxon t in tempTBDTaxa) { HiddenTaxonList.Remove(t); } } AddListsToGroups(SelectedTaxonListSource); }