public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { int index = ((ImageViewController)referenceViewController).PageIndex; return((ImageViewController)ImageViewController.ImageViewControllerForPageIndex(index + 1)); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); viewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.None, 20f); // kick things off by making the first page ImageViewController pageZero = ImageViewController.ImageViewControllerForPageIndex(0); viewController.SetViewControllers(new UIViewController[] { pageZero }, UIPageViewControllerNavigationDirection.Forward, false, null); viewController.DataSource = new MyDataSource(); window.RootViewController = viewController; // make the window visible window.MakeKeyAndVisible(); return(true); }