private void MoveToLeft(ListItemViewModel item)
 {
     if (item != null)
     {
         RightItems.Remove(item);
         LeftItems.Add(item);
     }
 }
Exemple #2
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);
            DataContext = this;

            LeftItems.Add(new DataItem("Home", true, new HomePage()));
            LeftItems.Add(new DataItem("Intro to ECE", true, new BaseInfo()));
            LeftItems.Add(new DataItem("HOD's Welcome", true, new HODpage()));
            LeftItems.Add(new DataItem("Course Advisors", true, new ECE_Advisors()));
            LeftItems.Add(new DataItem("Contact Location", true, new ContactPage()));

            // Felix:  I use these titles in Courses, so I put them in a common place.
            Course EeeCourse = new Course()
            {
                ProgramTitle = (string)Application.Current.FindResource("EEE_Courses_Title"),
            };

            EeeCourse.readJSON(new Uri("pack://application:,,,/Resources/eeeCourseInfo.json"));

            Course CseCourse = new Course()
            {
                ProgramTitle = (string)Application.Current.FindResource("CSE_Courses_Title"),
            };

            CseCourse.readJSON(new Uri("pack://application:,,,/Resources/cseCourseInfo.json"));

            Course SeCourse = new Course()
            {
                ProgramTitle = (string)Application.Current.FindResource("SE_Courses_Title"),
            };

            SeCourse.readJSON(new Uri("pack://application:,,,/Resources/seCourseInfo.json"));

            // Needed the colours in the Courses page, so put them in a common file (Resources>Colours.xaml).
            string cseColour = (string)Application.Current.FindResource("Colour_CSE_Str");

            RightItems.Add(new DataItem("CSE Info", true, new CSEInfo(), cseColour));
            RightItems.Add(new DataItem("CSE Courses", true, CseCourse, cseColour));
            string eeeColour = (string)Application.Current.FindResource("Colour_EEE_Str");

            RightItems.Add(new DataItem("EEE Info", true, new EEEInfo(), eeeColour));
            RightItems.Add(new DataItem("EEE Courses", true, EeeCourse, eeeColour));
            string seColour = (string)Application.Current.FindResource("Colour_SE_Str");

            RightItems.Add(new DataItem("SE Info", true, new SEInfo(), seColour));
            RightItems.Add(new DataItem("SE Courses", true, SeCourse, seColour));
        }