private void popProfessionalAdvisors(Wrappers.ProfessonalAdvisors advisors) { TutorsAndLabInfoTitle.Text = advisors.title; int count = 0; TextBlock tb1; TextBlock tb2; HyperlinkButton hl3; RowDefinition rd; Grid gr = new Grid(); ColumnDefinition cd1 = new ColumnDefinition(); ColumnDefinition cd2 = new ColumnDefinition(); ColumnDefinition cd3 = new ColumnDefinition(); cd1.Width = new GridLength(1, GridUnitType.Star); cd2.Width = new GridLength(1, GridUnitType.Star); cd3.Width = new GridLength(1, GridUnitType.Star); gr.ColumnDefinitions.Add(cd1); gr.ColumnDefinitions.Add(cd2); gr.ColumnDefinitions.Add(cd3); Thickness thickness = new Thickness(5); foreach (Wrappers.AdvisorInformation info in advisors.advisorInformation) { rd = new RowDefinition(); rd.Height = new GridLength(1, GridUnitType.Star); gr.RowDefinitions.Add(rd); tb1 = new TextBlock(); tb2 = new TextBlock(); hl3 = new HyperlinkButton(); tb1.Text = info.name; tb2.Text = info.department; hl3.Content = "Contact"; hl3.NavigateUri = new System.Uri("mailto:" + info.email); tb1.Padding = thickness; tb2.Padding = thickness; hl3.Padding = thickness; tb1.TextWrapping = TextWrapping.WrapWholeWords; tb2.TextWrapping = TextWrapping.WrapWholeWords; Grid.SetColumn(tb1, 0); Grid.SetColumn(tb2, 1); Grid.SetColumn(hl3, 2); Grid.SetRow(tb1, count); Grid.SetRow(tb2, count); Grid.SetRow(hl3, count++); gr.Children.Add(tb1); gr.Children.Add(tb2); gr.Children.Add(hl3); TALIScrollViewer.Content = gr; } }
private void populateStudentServicesSection(Wrappers.StudentServices ss) { StudentServicesTitle.Text = ss.title; Wrappers.AcademicAdvisors academicAdvisors = ss.academicAdvisors; Wrappers.ProfessonalAdvisors professonalAdvisors = ss.professonalAdvisors; Wrappers.FacultyAdvisors facultyAdvisors = ss.facultyAdvisors; Wrappers.IstMinorAdvising istMinorAdvising = ss.istMinorAdvising; popAcademicAdvisors(academicAdvisors); popProfessionalAdvisors(professonalAdvisors); popFacultyAdvisors(facultyAdvisors); popIstMinorAdvising(istMinorAdvising); }