コード例 #1
0
ファイル: MotherViewModel.cs プロジェクト: balrajg/ipa-master
        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);
            });
        }
コード例 #2
0
		protected override void OnAppearing ()
		{
			base.OnAppearing ();
			ParticipantReportViewModel vm = (ParticipantReportViewModel)this.BindingContext;
			this.BindingContext = vm;
		}