public async Task LoadAsync(BaseEntityDto <Coordinator> coordinator) { ProggressBarVisible(true); _connectedUserAuth = coordinator.ConnectedUser; _connectedUser = _connectedUserAuth; _httpClientService.SetAuthorizationHeaderToken(_httpClientService.HttpClient, _connectedUser.Token); _connectedUserJson = JsonConvert.SerializeObject(_connectedUser, Formatting.Indented); if (_connectedUser.Role == "Admin") { AddCoordCommandVisibility = Visibility.Visible; } else { AddCoordCommandVisibility = Visibility.Collapsed; } _reportCoordView = new ReportsVolView(_connectedUserAuth); OnPropertyChanged(nameof(AddCoordCommandVisibility)); List <Volunteer> getVolunteers = await LoadItems(); _volunteerCoordView = new VolunteerCoordView(_connectedUser, _volunteers, _schools); _projectsCoordView = new ProjectVolView(_connectedUser, _volunteers, _schools); ProggressBarVisible(false); _volunteersDto = await LoadVolunteerDtosAsync(getVolunteers); _volunteerCoordView = new VolunteerCoordView(_volunteersDto, _schools); var projects = await LoadProjectsAsync(_volunteers); _projectsCoordView = new ProjectVolView(projects, _volunteers, _schools); }
public void Load(BaseEntityDto <Volunteer> volunteerDto) { _volunteerDto = volunteerDto; _connectedUser = volunteerDto.ConnectedUser; _generalInfoView = new GeneralInfoView(_volunteerDto); _projectVolView = new ProjectVolView(_volunteerDto); _frameContent = _generalInfoView; RaisePropertyChanged(nameof(FrameContent)); }
public HomeVolunteerViewModel(INavigationService navigationService, IHttpClientService httpClientService) : base(navigationService, httpClientService) { _reportsVolView = new ReportsVolView(); _homeVolView = new HomeVolView(); _assignmentVolView = new AssignmentVolView(); _projectVolView = new ProjectVolView(); _notificationVolView = new NotificationVolView(); _frameContent = _homeVolView; _projectCommandBarVisibility = Visibility.Collapsed; }
public HomeCoordViewModel(INavigationService navigationService, IHttpClientService httpClientService) : base(navigationService, httpClientService) { _reportCoordView = new ReportsVolView(); _projectsCoordView = new ProjectVolView(); _assignmentCoordView = new AssignmentCoordView(); _notificationsCoordView = new NotificationsCoordView(); _trainingCoordView = new TrainingCoordView(); _volunteers = new List <Volunteer>(); _volunteersDto = new List <BaseEntityDto <Volunteer> >(); _schoolDtos = new List <SchoolDto>(); _projects = new List <ProjectDto>(); _frameContent = _reportCoordView; _title = "Reports"; OnPropertyChanged(nameof(FrameContent)); }
public async Task LoadAsync(BaseEntityDto <Volunteer> volunteer) { ProggressBarVisible(true); _volunteer = volunteer; _connectedVolunteer = _volunteer.Entity; _connectedUserAuth = volunteer.ConnectedUser; _httpClientService.SetAuthorizationHeaderToken(_httpClientService.HttpClient, _connectedUserAuth.Token); _projectVolView = new ProjectVolView(volunteer); _reportsVolView = new ReportsVolView(_connectedUserAuth); ProggressBarVisible(false); var school = await _httpClientService.GetTAsync <School>($"school/getbyid/{volunteer.Entity.SchoolVolunteers.First(s => s.IsActual == true)}"); var projects = await EntityLoadingHelper.LoadProjectsAsync(new List <Volunteer> { _connectedVolunteer }, _httpClientService, new List <ProjectDto>(), _connectedUserAuth); _projectVolView = new ProjectVolView(projects, new List <Volunteer> { volunteer.Entity }, new List <School> { school }); }
public VolDetailsViewModel(INavigationService navigationService, IHttpClientService httpClientService) : base(navigationService, httpClientService) { _generalInfoView = new GeneralInfoView(); _projectVolView = new ProjectVolView(); }