示例#1
0
        public async Task PrepareWorkList()
        {
            if (WorkListLoaded)
            {
                return;
            }
            List <Work> list = Model.GetWorkList(CourseId);

            WorkList.Clear();
            foreach (Work work in list)
            {
                WorkList.Add(new WorkVM(work));
            }

            string id = CourseId;

            if (await Model.RefWorkList(CourseId) == MainModel.UpdateResult.Success)
            {
                if (id == CourseId)
                {
                    WorkList.Clear();
                    foreach (Work work in list)
                    {
                        WorkList.Add(new WorkVM(work));
                    }
                }
            }
            WorkListLoaded = true;
            RaisePropertyChanged("WorkList");
        }
示例#2
0
 public void SetWorksList(List <WorksInfoDataModel> data)
 {
     data = data.OrderBy(p => p.Name).ToList();
     WorkList.Clear();
     data.ForEach(o => WorkList.Add(o));
     if (LoadWorkListComplete != null)
     {
         LoadWorkListComplete(this, new EventArgs());
     }
 }
示例#3
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");
 }