public TeamEditorWindowViewModel(TeamEditorWindow teamEditWindow, Team selectedTeam) { this.SourceWindow = teamEditWindow; this._contextDal = new TeamDAL(); this.SelectedTeam = selectedTeam; this.SaveCommand = new RelayCommand(SaveTeam, CanExecute); this.StudentList = new ObservableCollection <Student>(((TeamDAL)_contextDal).StudentList.Where(x => x.TeamID == selectedTeam.ID)); this.SessionGroupList = new ObservableCollection <SessionGroup>(((TeamDAL)_contextDal).SessionGroupList); }
private void EditTeam(object param) { TeamEditorWindow target = new TeamEditorWindow((Team)((DataGrid)param).SelectedItem) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.TeamList = ReloadActiveTeamList(); this.StudentList = ReloadStudentList(); this.TeamFilterList = ReloadTeamFilterList(); }
private void CreateTeam() { Team team = new Team(); TeamEditorWindow target = new TeamEditorWindow(team) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.TeamList = ReloadActiveTeamList(); this.TeamFilterList = ReloadTeamFilterList(); }