Example #1
0
        public async Task PrepareNoticeList()
        {
            if (NoticeListLoaded)
            {
                return;
            }
            List <Notice> list = Model.GetNoticeList(CourseId);

            NoticeList.Clear();
            foreach (Notice notice in list)
            {
                NoticeList.Add(new NoticeVM(notice));
            }

            string id = CourseId;

            if (await Model.RefNoticeList(CourseId) == MainModel.UpdateResult.Success)
            {
                if (id == CourseId)
                {
                    NoticeList.Clear();
                    foreach (Notice notice in list)
                    {
                        NoticeList.Add(new NoticeVM(notice));
                    }
                }
            }
            NoticeListLoaded = true;
            RaisePropertyChanged("NoticeList");
        }
Example #2
0
 public void ChangeCourse(string courseId)
 {
     if (courseId == CourseId)
     {
         return;
     }
     CourseId   = courseId;
     Course     = (Model.GetCourseList()).Find(c => c.Id == courseId);
     CourseName = Course.Name;
     NoticeList.Clear();
     NoticeListLoaded = false;
     FileList.Clear();
     FileListLoaded = false;
     WorkList.Clear();
     WorkListLoaded = false;
     UpdateNumbers();
     RaisePropertyChanged("CourseName");
 }