Ejemplo n.º 1
0
        private async Task AddActivities()
        {
            var viewModel = new ActivitiesDetailViewModel(new ActivitiesTableViewModel(), _activitiesStore, _pageService);

            viewModel.ActivityAdded += (source, activity) =>
            {
                Activities.Add(new ActivitiesTableViewModel(activity));
            };

            await _pageService.PushModalAsync(new ActivitiesDetailPage(viewModel));
        }
Ejemplo n.º 2
0
        private async Task SelectActivities(ActivitiesTableViewModel activities)
        {
            if (activities == null)
            {
                return;
            }

            SelectedActivity = null;

            var viewModel = new ActivitiesDetailViewModel(activities, _activitiesStore, _pageService);

            viewModel.ActivityUpdated += (source, updateActivity) =>
            {
                activities.Id        = updateActivity.id;
                activities.StudentID = updateActivity.studentID;
                activities.ModuleID  = updateActivity.moduleID;
                activities.Grade     = updateActivity.grade;
                activities.DueDate   = updateActivity.dueDate;
                activities.Weight    = updateActivity.weight;
                activities.Type      = updateActivity.type;
            };

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