示例#1
0
        public void LoadTeachers()
        {
            _teachers = new ObservableCollection <TeacherViewModel>(
                dbContext.Teachers.Select(t => TeacherViewModel.FromTeacher(t)).ToList());

            PropertyChanged.Invoke(this, new PropertyChangedEventArgs(nameof(Teachers)));
        }
示例#2
0
 public void AddTeacher(Teacher teacher)
 {
     _teachers.Add(TeacherViewModel.FromTeacher(teacher));
     PropertyChanged.Invoke(this, new PropertyChangedEventArgs(nameof(Teachers)));
 }