protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // loading existing data for info page and announcement page
            base.OnNavigatedTo(e);

            string index = "";

            if (NavigationContext.QueryString.TryGetValue("moduleIndex", out index))
            {
                moduleIndex = Convert.ToInt32(index);
            }

            if ((Application.Current as App).online.Equals(false))
            {
                selectedModule = (Application.Current as App).modules[moduleIndex];

                foreach (Announcement at in selectedModule.moduleAnnouncements)
                {
                    at.GenerateDisplayContent(selectedModule.moduleCode);
                }

                // change the context to fit the selected module
                ModuleCodeTitle.Text = selectedModule.moduleCode;
                ModuleCode.Text = selectedModule.moduleCode;
                ModuleTitle.Text = selectedModule.moduleName;
                Semester.Text = selectedModule.moduleSemester;
                ModuleCredits.Text = selectedModule.moduleMc;
                Department.Text = selectedModule.moduleDepart;

                Facilitators.ItemsSource = selectedModule.moduleLecturers;

                AnnounceInfo.ItemsSource = selectedModule.moduleAnnouncements;

                WorkbinInfo.ItemsSource = Folders;
            }
            else
            {
                // initiate local variables with global variables
                selectedModule = (Application.Current as App).modules[moduleIndex];

                // change the context to fit the selected module
                ModuleCodeTitle.Text = selectedModule.moduleCode;
                ModuleCode.Text = selectedModule.moduleCode;
                ModuleTitle.Text = selectedModule.moduleName;
                Semester.Text = selectedModule.moduleSemester;
                ModuleCredits.Text = selectedModule.moduleMc;
                Department.Text = selectedModule.moduleDepart;

                Facilitators.ItemsSource = selectedModule.moduleLecturers;

                AnnounceInfo.ItemsSource = selectedModule.moduleAnnouncements;

                WorkbinInfo.ItemsSource = Folders;

                if (Folders.Count == 0)
                {
                    getWorkbinData();
                }
            }     
        }
Example #2
0
 public Class(Module m, DateTime st, int d, DateTime et, String l)
 {
     module = m;
     startTime = st;
     duration = d;
     endTime = et;
     location = l;
     heightOfItem = 4 * d;
 }
 public ModuleInfoWrapper(Module[] ms, String cs)
 {
     modules = ms;
     comments = cs;
 }