public AddExamViewModel(Student student, AddExamView window) { this.Student = student; this.Exam = new Exam(); this.window = window; this.SaveCommand = new MyCommand(SaveExam); this.CancelCommand = new MyCommand(Cancel); }
private void ExecuteEdit(object p) { if (p != null && p is Exam) { var exam = p as Exam; AddExamView view = new AddExamView(exam); view.ShowDialog(); } }
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; } }
private void AddExam(object property) { AddExamView window = new AddExamView((Student)property); window.ShowDialog(); }
private void ExecuteOpen() { AddExamView view = new AddExamView(); view.ShowDialog(); }