Ejemplo n.º 1
0
        override public UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController)
        {
            ContentViewController currentPage = referenceViewController as ContentViewController;

            if (currentPage.Index == 0)
            {
                return(pages[pages.Count - 1]);
            }
            else
            {
                return(pages[currentPage.Index - 1]);
            }
        }
        public MyPageViewController() : base(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal)
        {
            View.Frame = UIScreen.MainScreen.Bounds;
            ContentViewController cvc0 = new ContentViewController(0, UIColor.Red);

            cvc0.View.AddGestureRecognizer(new UITapGestureRecognizer(() => {
                new UIAlertView("Error", "Please enter all the required details.", null, "OK", null).Show();
            }));
            pages.Add(cvc0);
            pages.Add(new ContentViewController(1, UIColor.Green));
            pages.Add(new ContentViewController(2, UIColor.Blue));
            DataSource = new PageDataSource(pages);
            SetViewControllers(new UIViewController[] { pages [0] as UIViewController }, UIPageViewControllerNavigationDirection.Forward, false, null);
        }
Ejemplo n.º 3
0
        override public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController)
        {
            ContentViewController currentPage = referenceViewController as ContentViewController;

            return(pages [(currentPage.Index + 1) % pages.Count]);
        }