private void AssignmentList_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (AssignmentList.SelectedItem != null) { string name = AssignmentList.SelectedItem.ToString(); AssignmentViewModel AVM = new AssignmentViewModel(); SchoolCourseViewModel SCM = new SchoolCourseViewModel(); foreach (AssignmentViewModel task in currentAssignments) { if (task.Name.Equals(name)) { AVM = task; } } foreach (SchoolCourseViewModel course in currentCourses) { if (course.Id == AVM.Course_Id) { SCM = course; } } assignment.OpenTab(AVM, SCM); assignment.Show(); } }
private void Participation_List_SelectionChanged(object sender, SelectionChangedEventArgs e) { string assignment = Participation_List.SelectedItem.ToString(); Assignment currentAssignment = totalAssignments.First(item => item.Name.Equals(assignment)); AssignWin = new AssignmentWindow(currentAssignment, this); Hide(); AssignWin.Show(); }