Example #1
0
        public SchoolsAndTeachersViewModel(IHttpClientService httpClientService, INavigationService navigationService) : base(navigationService, httpClientService)
        {
            _schoolsView  = new ListSchoolsView();
            _frameContent = _schoolsView;

            _title      = "Schools";
            CanNavigate = false;
            RaisePropertyChanged(nameof(CanNavigate));
            RaisePropertyChanged(nameof(FrameContent));
        }
Example #2
0
        public async Task Load(UserAuthDto connectedUser)
        {
            ProggressBarVisible(true);
            _connectedUser = connectedUser;
            _httpClientService.SetAuthorizationHeaderToken(_httpClientService.HttpClient, _connectedUser.Token);
            _userEditDto = new UserEditDto(new BaseEntity())
            {
                ConnectedUser = _connectedUser,
                Type          = Shared.Helpers.TypeEnum.None,
                IsNew         = null
            };//Used to notify while navigating to Addschooteacherpage wether it should create a new entity or upadate an existing one based on the Type
            _userEditDtoJson = JsonConvert.SerializeObject(_userEditDto);
            await InitialLoad();

            ProggressBarVisible(false);
            await LoadItemsAsync();

            _schoolsView  = new ListSchoolsView(_listSchoolsViewModel);
            _teachersView = new ListTeachersView(_listTeachersViewModel);
            _frameContent = _schoolsView;
            RaisePropertyChanged(nameof(FrameContent));
            RaisePropertyChanged(nameof(CanNavigate));
        }