public void RemoveEquipmentSlot() { if (SelectedEquipmentSlot != null) { EquipmentSlots.Remove(SelectedEquipmentSlot); foreach (var a in MainViewModel.MainViewModelStatic.Items) { if (a.EquipmentRef != null) { var b = a.EquipmentRef; if (b.OccupiesSlots.Contains(SelectedEquipmentSlot)) { b.OccupiesSlots.Remove(SelectedEquipmentSlot); } if (b.CoversSlots.Contains(SelectedEquipmentSlot)) { b.CoversSlots.Remove(SelectedEquipmentSlot); } } } SelectedEquipmentSlot = null; } }