Ejemplo n.º 1
0
 public static Task <LessonsPageViewModel> GetLessonsViewModel(LessonsNavigationParameter navigationParameter)
 {
     return(Task <LessonsPageViewModel> .Factory.StartNew(() =>
     {
         var vm = Container.Resolve <LessonsPageViewModel>();
         vm.Initialize(navigationParameter);
         return vm;
     }));
 }
Ejemplo n.º 2
0
        public void Execute(object parameter)
        {
            var faculty = _dataProvider.GetFacultyByUniversityAndGroupId(_university.Id, _group.Id);

            if (faculty == null)
            {
                return;
            }
            _flurryPublisher.PublishContextMenuShowGroupTimeTable(_university, _group.GroupName, _group.Id);
            var navigationParameter = new LessonsNavigationParameter
            {
                Id           = _group.Id,
                IsTeacher    = false,
                FacultyId    = faculty.Id,
                UniversityId = _university.Id
            };

            _navigationService.NavigateTo <LessonsPageViewModel, LessonsNavigationParameter>(navigationParameter);
        }
Ejemplo n.º 3
0
        public override Uri MapUri(Uri uri)
        {
            Debug.WriteLine("UriMapper:MapUri for {0}", uri.OriginalString);
            if (!uri.OriginalString.Contains("/View/EntryPoint.xaml"))
            {
                return(uri);
            }

            if (_applicationSettings.Me.DefaultGroup != null || _applicationSettings.Me.Teacher != null)
            {
                var isTeacher           = _applicationSettings.Me.Teacher != null;
                var navigationParameter = new LessonsNavigationParameter
                {
                    Id           = isTeacher ? _applicationSettings.Me.Teacher.Id : _applicationSettings.Me.DefaultGroup.Id,
                    IsTeacher    = isTeacher,
                    UniversityId = _applicationSettings.Me.University.Id,
                    FacultyId    = _applicationSettings.Me.Faculty.Id
                };
                return(NavigationService.GetUri <NewLessonsPage, LessonsNavigationParameter>(navigationParameter));
            }

            var navigationFlow = new NavigationFlow();

            if (_applicationSettings.Me.Faculty != null)
            {
                navigationFlow.FacultyId      = _applicationSettings.Me.Faculty.Id;
                navigationFlow.UniversityId   = _applicationSettings.Me.University.Id;
                navigationFlow.UniversityName = _applicationSettings.Me.University.ShortName;
                navigationFlow.FacultyName    = _applicationSettings.Me.Faculty.Title;
                return(NavigationService.GetUri <NewGroupsPage, NavigationFlow>(navigationFlow));
            }
            if (_applicationSettings.Me.University != null)
            {
                navigationFlow.UniversityId   = _applicationSettings.Me.University.Id;
                navigationFlow.UniversityName = _applicationSettings.Me.University.ShortName;
                return(NavigationService.GetUri <NewFacultiesPage, NavigationFlow>(navigationFlow));
            }
            if (_applicationSettings.Me.Role != UserRole.None)
            {
                return(NavigationService.GetUri <NewUniversitiesPage, Reason>(Reason.Registration));
            }
            return(NavigationService.GetUri <FirstPage>());
        }