Esempio n. 1
0
        private void populateStudyAbroadSection(Wrappers.StudyAbroad sa)
        {
            StudyAbroadTitle.Text       = sa.title;
            StudyAbroadDescription.Text = sa.description;

            int              count = 0;
            TextBlock        tb1;
            TextBlock        tb2;
            RowDefinition    rd;
            Grid             gr  = new Grid();
            ColumnDefinition cd1 = new ColumnDefinition();
            ColumnDefinition cd2 = new ColumnDefinition();

            cd1.Width = new GridLength(1, GridUnitType.Star);
            cd2.Width = new GridLength(1, GridUnitType.Star);
            gr.ColumnDefinitions.Add(cd1);
            gr.ColumnDefinitions.Add(cd2);
            Thickness thickness = new Thickness(5);

            foreach (Wrappers.Place place in sa.places)
            {
                rd        = new RowDefinition();
                rd.Height = new GridLength(1, GridUnitType.Star);
                gr.RowDefinitions.Add(rd);

                tb1 = new TextBlock();
                tb2 = new TextBlock();

                tb1.Text    = place.nameOfPlace;
                tb2.Text    = place.description;
                tb1.Padding = thickness;
                tb2.Padding = thickness;

                tb1.TextWrapping = TextWrapping.WrapWholeWords;
                tb2.TextWrapping = TextWrapping.WrapWholeWords;

                Grid.SetColumn(tb1, 0);
                Grid.SetColumn(tb2, 1);
                Grid.SetRow(tb1, count);
                Grid.SetRow(tb2, count++);

                gr.Children.Add(tb1);
                gr.Children.Add(tb2);

                StudyAbroadScrollViewer.Content = gr;
            }
        }
Esempio n. 2
0
        private async void populateRecoursesAsync(object sender)
        {
            HttpResponseMessage response = await client.GetAsync(API_RESOURCES);

            if (response.IsSuccessStatusCode)
            {
                resources = await response.Content.ReadAsAsync <Wrappers.Resources>();

                studyAbroad        = resources.studyAbroad;
                studentServices    = resources.studentServices;
                tutorsAndLabInfo   = resources.tutorsAndLabInformation;
                studentAmbassadors = resources.studentAmbassadors;

                MainHeader.Text              = resources.title;
                StudyAbroadTitle.Text        = studyAbroad.title;
                StudentServicesTitle.Text    = studentServices.title;
                TutorsAndLabInfoTitle.Text   = tutorsAndLabInfo.title;
                StudentAmbassadorsTitle.Text = studentAmbassadors.title;

                populateStudyAbroadSection(studyAbroad);
                populateStudentServicesSection(studentServices);
                populateTutorsAndLabInfo(tutorsAndLabInfo);
            }
        }