private void ExecuteDelete(object parameter) { IMessageBoxService msg = new MessageBoxService(); string title = "Deleting Project Type"; string confirmtxt = "Do you want to delete the selected item"; if (ProjectTypes.Where(x => x.IsChecked).Count() > 1) { title = title + "s"; confirmtxt = confirmtxt + "s"; } if (msg.ShowMessage(confirmtxt + "?", title, GenericMessageBoxButton.OKCancel, GenericMessageBoxIcon.Question).Equals(GenericMessageBoxResult.OK)) { foreach (ProjectTypeModel si in ProjectTypes) { if (si.IsChecked) { if (si.ID > 0) { DeleteProjectType(si.ID); } deleteditems.Add(si); } } foreach (ProjectTypeModel pm in deleteditems) { ProjectTypes.Remove(pm); } deleteditems.Clear(); CheckValidation(); } msg = null; }