public override void ViewDidLoad() { base.ViewDidLoad(); // create a UIPageViewController that pages horizontally (min puts the spine on the left pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min); // size the view controller so it fills the containing View (context is this.View.Bounds) pageViewController.View.Frame = View.Bounds; // place the pageViewController inside the UIViewController View.AddSubview(pageViewController.View); courseManager = new CourseManager(categoryTitle); courseManager.MoveFirst(); CoursePagerViewControllerDataSource dataSource = new CoursePagerViewControllerDataSource(courseManager); pageViewController.DataSource = dataSource; // Create an instance of the CourseViewController for the current course of the CourseManager CourseViewController firstCourseViewController = dataSource.GetFirstViewController(); pageViewController.SetViewControllers(new UIViewController[] { firstCourseViewController }, UIPageViewControllerNavigationDirection.Forward, false, null); // assign delegate methods //pageViewController.GetNextViewController = GetNextViewController; //pageViewController.GetPreviousViewController = GetPreviousViewController; }
public override void ViewDidLoad() { base.ViewDidLoad(); // create page/view pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min); //sizes pageViewController.View.Frame = View.Bounds; //sets location View.AddSubviews(pageViewController.View); courseManager = new CourseManager(); courseManager.MoveFirst(); CoursePagerViewControllerDataSource dataSource = new CoursePagerViewControllerDataSource(courseManager); pageViewController.DataSource = dataSource; //OLD CourseViewController firstCourseViewController = CreateCoursesViewController(); CourseViewController firstCourseViewController = dataSource.GetFirstViewController(); pageViewController.SetViewControllers(new UIViewController[] { firstCourseViewController }, UIPageViewControllerNavigationDirection.Forward, false, null); //pageViewController.GetNextViewController = GetNextViewController; //pageViewController.GetPreviousViewController = GetPreviousViewController; }