public void LoadTeachers() { _teachers = new ObservableCollection <TeacherViewModel>( dbContext.Teachers.Select(t => TeacherViewModel.FromTeacher(t)).ToList()); PropertyChanged.Invoke(this, new PropertyChangedEventArgs(nameof(Teachers))); }
public void AddTeacher(Teacher teacher) { _teachers.Add(TeacherViewModel.FromTeacher(teacher)); PropertyChanged.Invoke(this, new PropertyChangedEventArgs(nameof(Teachers))); }