private void ContextRemoveItemFromUpgradeList_Click(object sender, RoutedEventArgs e) { UpgradesComparison uc = MainPage.Instance.DG_UpgradesComparison; if (uc == null) { NameGrid_MouseLeftButtonUp(null, null); return; } foreach (CharacterSlot slot in Character.EquippableCharacterSlots) { // Fix it each of the slot calcs if (slot == CharacterSlot.Finger2 || slot == CharacterSlot.Trinket2 || slot == CharacterSlot.Tabard || slot == CharacterSlot.Shirt) { continue; } string key = "Gear." + slot.ToString(); List <Optimizer.ComparisonCalculationUpgrades> list = uc.itemCalculations[key].ToList(); list.RemoveAll(gg => gg.ItemInstance == this.ItemInstance); uc.itemCalculations[key] = list.ToArray(); } { // Fix it in the All calcs string key = "Gear.All"; List <Optimizer.ComparisonCalculationUpgrades> list = uc.itemCalculations[key].ToList(); list.RemoveAll(gg => gg.ItemInstance == this.ItemInstance); uc.itemCalculations[key] = list.ToArray(); } uc.UpdateGraph(); }