public AddExamViewModel(AddExamView view, Exam editExam) { this.view = view; this.editExam = editExam; ExamPeriods = new ObservableCollection <ExamPeriod>(ServiceDataProvider.GetAllExamPeriods()); Courses = new ObservableCollection <Course>(ServiceDataProvider.GetAllCourses()); if (editExam != null) { ExamPeriodId = editExam.ExamPeriodId; CourseId = editExam.CourseId; DateAndTime = editExam.DateAndTime; Place = editExam.Place; Price = editExam.Price; IsPassed = editExam.IsPassed; } }
public ExamPeriodViewModel() { ExamPeriods = new ObservableCollection <ExamPeriod>(ServiceDataProvider.GetAllExamPeriods()); ServiceDataProvider.AddExamPeriodNotification += ServiceDataProvider_AddExamPeriodNotification; }