/// <summary> /// Sets all comboboxes to their default value /// </summary> public void ClearFilters() { SelectedFirstName = StudentCollection.Where(i => i.StudentFirstName == "None").Single(); SelectedLastName = StudentCollection.Where(i => i.StudentLastName == "None").Single(); SelectedMajor = MajorCollection.Where(i => i.MajorDescription == "None").Single(); SelectedStudentYear = StudentYearCollection.Where(i => i.StudentYearDescription == "None").Single(); AllStudentInformation.Clear(); PopulateResultView_NoFilters(); }
/// <summary> /// Enables/Disables "Clear Filters" button /// </summary> /// <returns></returns> public bool IsClearable() { return(IsClearEnabled = ((SelectedFirstName != null && SelectedFirstName.StudentFirstName != StudentCollection.Where(i => i.StudentFirstName == "None").Select(i => i.StudentFirstName).Single()) || (SelectedLastName != null && SelectedLastName.StudentFirstName != StudentCollection.Where(i => i.StudentLastName == "None").Select(i => i.StudentLastName).Single()) || (SelectedMajor != null && SelectedMajor.MajorDescription != MajorCollection.Where(i => i.MajorDescription == "None").Select(i => i.MajorDescription).Single()) || (SelectedStudentYear != null && SelectedStudentYear.StudentYearDescription != StudentYearCollection.Where(i => i.StudentYearDescription == "None").Select(i => i.StudentYearDescription).Single()))); }