Example #1
0
        public override UIViewController GetPreviousViewController(UIKit.UIPageViewController pageViewController, UIViewController referenceViewController)
        {
            CurrentPage = referenceViewController as UIPageViewControllerItem;
            if (CurrentPage != null) {

                if (OldPage != null)
                    OldPage.IsActive = false;
                CurrentPage.IsActive = true;

                OldPage = CurrentPage;

                if (CurrentPage.ListIndex == 0) {
                    return null;
                } else {
                    return _pages [CurrentPage.ListIndex - 1];
                }
            } else
                return null;
        }
Example #2
0
        public override UIViewController GetNextViewController(UIKit.UIPageViewController pageViewController, UIViewController referenceViewController)
        {
            CurrentPage = referenceViewController as UIPageViewControllerItem;
            if (CurrentPage != null) {

                if (CurrentPage.ListIndex != 0) {
                    if (OldPage != null)
                        OldPage.IsActive = false;
                    CurrentPage.IsActive = true;
                    OldPage = CurrentPage;
                }

                if (CurrentPage.ListIndex == _pages.Count - 1) {
                    return null;
                }

                return _pages [(CurrentPage.ListIndex + 1)];
            } else
                return null;
        }