Beispiel #1
0
        void InitPartnerMode(MotherPage page, List <Course> courseList, string courseIdToSelect = null)
        {
            PartnerHomePage      homePage      = new PartnerHomePage();
            PartnerHomeViewModel homeViewModel = new PartnerHomeViewModel(courseList, courseIdToSelect);

            HomeViewModel           = homeViewModel;
            homePage.BindingContext = homeViewModel;
            //notification for mark attendance.


            //		ForumPage forumPage = new ForumPage ();
            //		ForumListPageViewModel forumViewModel = new ForumListPageViewModel (courseList);
            //		ForumViewModel = forumViewModel;
            //		forumPage.BindingContext = forumViewModel;

            SettingPage      settingPage      = new SettingPage();
            SettingViewModel settingViewModel = new SettingViewModel();

            SettingViewModel           = settingViewModel;
            settingPage.BindingContext = new SettingViewModel();


            Device.BeginInvokeOnMainThread(() =>
            {
                page.Children.Add(homePage);
                //page.Children.Add (forumPage);
                page.Children.Add(settingPage);
                NavigationHandler.GlobalNavigator.Navigation.PushAsync(page, true);
                homeViewModel.LaunchActivity(courseIdToSelect);
            });
        }
Beispiel #2
0
        private void InitParticipantMode(MotherPage motherPage, List <Course> courseList, string courseId = null, string activityId = null)
        {
            ParticipantHomePage      homePage      = new ParticipantHomePage();
            ParticipantHomeViewModel homeViewModel = new ParticipantHomeViewModel(courseList, courseId, activityId);

            HomeViewModel           = homeViewModel;
            homePage.BindingContext = homeViewModel;

            ParticipantReportPage      reportPage      = new ParticipantReportPage();
            ParticipantReportViewModel reportViewModel = new ParticipantReportViewModel(courseList);

            ReportViewModel           = reportViewModel;
            reportPage.BindingContext = reportViewModel;

            //ForumPage forumPage = new ForumPage ();
            //ForumListPageViewModel forumViewModel = new ForumListPageViewModel (courseList);
            //ForumViewModel = forumViewModel;
            //forumPage.BindingContext = forumViewModel;

            SettingPage      settingPage      = new SettingPage();
            SettingViewModel settingViewModel = new SettingViewModel();

            SettingViewModel           = settingViewModel;
            settingPage.BindingContext = new SettingViewModel();


            Device.BeginInvokeOnMainThread(() => {
                motherPage.Children.Add(homePage);
                motherPage.Children.Add(reportPage);
                //motherPage.Children.Add (forumPage);
                motherPage.Children.Add(settingPage);
                NavigationHandler.GlobalNavigator.Navigation.PushAsync(motherPage);
            });
        }
Beispiel #3
0
        void InitClientMode(MotherPage page, List <Course> courseList)
        {
            ClientHomePage      homePage      = new ClientHomePage();
            ClientHomeViewModel homeViewModel = new ClientHomeViewModel(courseList);

            HomeViewModel           = homeViewModel;
            homePage.BindingContext = homeViewModel;

            ClientReportPage      reportPage      = new ClientReportPage();
            ClientReportViewModel reportViewModel = new ClientReportViewModel();

            ReportViewModel           = reportViewModel;
            reportPage.BindingContext = reportViewModel;

//			ForumPage forumPage = new ForumPage ();
//			ForumListPageViewModel forumViewModel = new ForumListPageViewModel (courseList);
//			ForumViewModel = forumViewModel;
//			forumPage.BindingContext = forumViewModel;

            SettingPage      settingPage      = new SettingPage();
            SettingViewModel settingViewModel = new SettingViewModel();

            SettingViewModel           = settingViewModel;
            settingPage.BindingContext = new SettingViewModel();

            Device.BeginInvokeOnMainThread(() => {
                page.Children.Add(homePage);
                page.Children.Add(reportPage);
                //page.Children.Add (forumPage);
                page.Children.Add(settingPage);
                NavigationHandler.GlobalNavigator.Navigation.PushAsync(page, true);
            });
        }
Beispiel #4
0
        private async Task LoadMotherPage(List <Course> courseList, string courseIdToSelect = null, string activityIdToSelect = null)
        {
            MotherPage page     = new MotherPage();
            Role       userRole = App.GetUserRole();

            if (userRole == Role.Participant)
            {
                InitParticipantMode(page, courseList, courseIdToSelect, activityIdToSelect);
            }
            else if (userRole == Role.Manager)
            {
                InitManagerMode(page, courseList);
            }
            else if (userRole == Role.Client)
            {
                InitClientMode(page, courseList);
            }
            else if (userRole == Role.Partner)
            {
                InitPartnerMode(page, courseList, courseIdToSelect);
            }
            else if (userRole == Role.ManagerCumParticipant)
            {
                InitManagerMode(page, courseList);
            }
        }