Ejemplo n.º 1
0
        private async Task SelectStudents(StudentTableViewModel student)
        {
            if (student == null)
            {
                return;
            }

            SelectedStudent = null;

            var viewModel = new StudentDetailViewModel(student, _studentStore, _pageService);

            viewModel.StudentUpdated += (source, updateStudent) =>
            {
                student.Id          = updateStudent.id;
                student.AccountType = updateStudent.accountType;
                student.City        = updateStudent.city;
                student.CourseID    = updateStudent.courseID;
                student.DayOfBirth  = updateStudent.dayOfBirth;
                student.Email       = updateStudent.email;
                student.FirstName   = updateStudent.firstName;
                student.Gender      = updateStudent.gender;
                student.IdNumber    = updateStudent.idNumber;
                student.LastName    = updateStudent.lastName;
                student.Password    = updateStudent.password;
                student.PhoneNumber = updateStudent.phoneNumber;
                student.PostCode    = updateStudent.postCode;
                student.Status      = updateStudent.status;
                student.Street      = updateStudent.street;
                student.StudentID   = updateStudent.studentID;
            };

            await _pageService.PushModalAsync(new StudentDetailPage(viewModel));
        }
Ejemplo n.º 2
0
        private async Task AddStudents()
        {
            var viewModel = new StudentDetailViewModel(new StudentTableViewModel(), _studentStore, _pageService);

            viewModel.StudentAdded += (source, student) =>
            {
                Students.Add(new StudentTableViewModel(student));
            };

            await _pageService.PushModalAsync(new StudentDetailPage(viewModel));
        }