Beispiel #1
0
        void ic_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                Icons ic = sender as Icons;
                int id = ic.Id;
                switch (ic.Text)
                {
                    case "programming":
                        learningService.StudyingLevelGetAsync(id);
                        programming = programmingList.Where(p => p.ProgrammingID == id).FirstOrDefault();
                        break;
                    case "level":
                        learningService.SubjectGetAllWithLevelAsync(id);
                        level = levelList.Where(l => l.StudyLevelID == id).FirstOrDefault();
                        break;
                    case "subject":
                        //Link here

                        subject = subjectList.Where(s => s.SubjectID == id).FirstOrDefault();
                        if (subject.SubjectName == "Tiengviet")
                        {
                            HtmlPage.Window.Navigate(new Uri(webURL+"learningVietnamese/PreView.aspx",UriKind.RelativeOrAbsolute));
                        }
                        if (subject.SubjectName == "Toan")
                        {
                            HtmlPage.Window.Navigate(new Uri(webURL + "Learning/maths.aspx", UriKind.RelativeOrAbsolute));
                        }
                        break;
                }
            }
            catch
            {
                return;
            }
        }
Beispiel #2
0
 void ic_MouseEnter(object sender, MouseEventArgs e)
 {
     try
     {
         Icons ic = sender as Icons;
         int id = ic.Id;
         switch (ic.Text)
         {
             case "programming":
                 StudyProgramming st = new StudyProgramming();
                 st = programmingList.Where(p => p.ProgrammingID == id).FirstOrDefault();
                 this.ProgrammingNameTextBlock.Text = st.ProgrammingName;
                 this.LevelNameTextBlock.Text = "";
                 break;
             case "level":
                 StudyLevel lv = new StudyLevel();
                 lv = levelList.Where(l => l.StudyLevelID == id).FirstOrDefault();
                 this.LevelNameTextBlock.Text = lv.StudyLevelName;
                 this.SubjectNameTextBlock.Text = "";
                 break;
             case "subject":
                 Subject sb = new Subject();
                 sb = subjectList.Where(s => s.SubjectID == id).FirstOrDefault();
                 this.SubjectNameTextBlock.Text = sb.SubjectName;
                 break;
         }
     }
     catch
     {
         return;
     }
 }