Пример #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)));
 }