//Window Loaded public void Window_Loaded(object sender, RoutedEventArgs e) { //Find the resource oc = FindResource("myStudentList") as StudentList; //Query for all students all = from student in context.Students select student; totalCounter = 0; passedCounter = 0; //Add students to resource and count how many students foreach (var result in all) { oc.Add(result); totalCounter++; } //Count students that have achieved either an A, B, C or D passing grade foreach (var student in oc) { if (student.gradePassed(student.FinalGrade)) { studentPassed(student); } else { studentFailed(student); }; } PercentPassedCalc(totalCounter, passedCounter); //Displays the listbox, labels, etc. in the frame Main.Content = dis1; }
public void studentFailed(Student student) { failedStudents.Add(student); }
public void studentPassed(Student student) { passedStudents.Add(student); passedCounter++; }