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; }
private void ProjectTypes_ItemPropertyChanged(object sender, ItemPropertyChangedEventArgs e) { if (e.PropertyName != "IsChecked") { CheckValidation(); isdirty = true; } IsSelected = ProjectTypes.Where(x => x.IsChecked).Count() > 0; }
private bool IsColourMissing() { int nummissing = ProjectTypes.Where(x => string.IsNullOrEmpty(x.Colour.Trim())).Count(); return(nummissing > 0); }
private bool DescriptionMissing() { int nummissing = ProjectTypes.Where(x => string.IsNullOrEmpty(x.Description.Trim())).Count(); return(nummissing > 0); }