private void RemoveCityDistrictType(string settings) { DistrictSettings found = null; int i = 0; foreach (var dis in DistrictSettings) { if (dis.Type == settings) { found = dis; } i++; } if (found == null) { return; } _districtColors.RemoveAt(i); DistrictSettings.Remove(found); //RaisePropertyChanged("DistrictSettings"); }