private async void HardwareTypesViewModel_PropertyChangedAsync(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(SelectedHardwareType)) { if (SelectedHardwareType == null) { CustomItems.Clear(); return; } await LoadCustomItems(); } }
private async Task LoadCustomItems() { foreach (var wrappedItem in CustomItems) { wrappedItem.PropertyChanged -= WrappedCustomItem_PropertyChanged; } CustomItems.Clear(); var customItems = await _customItemRepository.GetCustomItemsByHardwareTypeAsync(SelectedHardwareType.Id); foreach (var item in customItems) { var wrappedModel = new CustomItemWrapper(item); wrappedModel.PropertyChanged += WrappedCustomItem_PropertyChanged; if (CustomItems.Contains(wrappedModel)) { continue; } CustomItems.Add(wrappedModel); } }
/// <summary> /// clears the data structure /// </summary> public void Clear() { AncestralAllele = null; AltAllele = null; ReferenceBegin = null; ReferenceName = null; DbSnpIds = null; ReferenceEnd = null; EvsCoverage = null; EvsSamples = null; ExacCoverage = null; GlobalMinorAllele = null; RefAllele = null; IsReferenceMinor = false; IsIntergenic = false; IsReference = false; IsReferenceNoCall = false; GlobalMinorAlleleFrequency = null; VariantId = null; VariantType = null; PhylopScore = null; AlleleFrequencyAdMixedAmerican = null; AlleleFrequencyAfrican = null; AlleleFrequencyAll = null; AlleleFrequencyEastAsian = null; AlleleFrequencyEuropean = null; AlleleFrequencySouthAsian = null; EvsAlleleFrequencyAfricanAmerican = null; EvsAlleleFrequencyEuropeanAmerican = null; EvsAlleleFrequencyAll = null; ExacAlleleFrequencyAll = null; ExacAlleleFrequencyAfrican = null; ExacAlleleFrequencyAmerican = null; ExacAlleleFrequencyEastAsian = null; ExacAlleleFrequencyFinish = null; ExacAlleleFrequencyNonFinish = null; ExacAlleleFrequencyOther = null; ExacAlleleFrequencySouthAsian = null; ExacAlleleNumberAfrican = null; ExacAlleleNumberAmerican = null; ExacAlleleNumberAll = null; ExacAlleleNumberEastAsian = null; ExacAlleleNumberFinish = null; ExacAlleleNumberNonFinish = null; ExacAlleleNumberOther = null; ExacAlleleNumberSouthAsian = null; ExacAlleleCountAfrican = null; ExacAlleleCountAmerican = null; ExacAlleleCountAll = null; ExacAlleleCountEastAsian = null; ExacAlleleCountFinish = null; ExacAlleleCountNonFinish = null; ExacAlleleCountOther = null; ExacAlleleCountSouthAsian = null; OneKgAlleleNumberAfrican = null; OneKgAlleleNumberAmerican = null; OneKgAlleleNumberAll = null; OneKgAlleleNumberEastAsian = null; OneKgAlleleNumberEuropean = null; OneKgAlleleNumberSouthAsian = null; OneKgAlleleCountAfrican = null; OneKgAlleleCountAmerican = null; OneKgAlleleCountAll = null; OneKgAlleleCountEastAsian = null; OneKgAlleleCountEuropean = null; OneKgAlleleCountSouthAsian = null; RefSeqTranscripts.Clear(); EnsemblTranscripts.Clear(); CosmicEntries.Clear(); ClinVarEntries.Clear(); RegulatoryRegions.Clear(); CustomItems.Clear(); CustomIntervals.Clear(); OverlappingGenes.Clear(); SvOverlappingTranscripts.Clear(); }