private void CreateStudent() { Student student = new Student(); StudentEditorWindow target = new StudentEditorWindow(student) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.StudentList = ReloadStudentList(); }
private void EditStudent(object param) { StudentEditorWindow target = new StudentEditorWindow((Student)((DataGrid)param).SelectedItem) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.StudentList = ReloadStudentList(); this.TeamList = ReloadActiveTeamList(); this.TeamFilterList = ReloadTeamFilterList(); }
public StudentEditorWindowViewModel(StudentEditorWindow teacherEditorWindow, Student student) { this.SourceWindow = teacherEditorWindow; this._contextDal = new StudentDAL(); this.UsersDal = new UsersDAL(); this.SelectedStudent = student; this.SaveCommand = new RelayCommand(SaveStudent, CanExecute); this.TeamList = new ObservableCollection <Team>(((StudentDAL)_contextDal).TeamList()); if (SelectedStudent.Users == null) { SelectedStudent.Users = new Users(); } }