public override void ViewDidLoad() { base.ViewDidLoad (); // Configure the page view controller and add it as a child view controller. PageViewController = new UIPageViewController (UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min); PageViewController.WeakDelegate = this; var startingViewController = ModelController.GetViewController (0, Storyboard); var viewControllers = new UIViewController[] { startingViewController }; PageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null); PageViewController.WeakDataSource = ModelController; AddChildViewController (PageViewController); View.AddSubview (PageViewController.View); // Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages. var pageViewRect = View.Bounds; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) pageViewRect = new CGRect (pageViewRect.X + 20, pageViewRect.Y + 20, pageViewRect.Width - 40, pageViewRect.Height - 40); PageViewController.View.Frame = pageViewRect; PageViewController.DidMoveToParentViewController (this); // Add the page view controller's gesture recognizers to the book view controller's view so that the gestures are started more easily. View.GestureRecognizers = PageViewController.GestureRecognizers; }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min); pageViewController.View.Frame = this.View.Bounds; this.View.AddSubview(pageViewController.View); courseManager = new CourseManager(Courses.Lib.Category.Android); courseManager.MoveFirst(); //CourseViewController firstCourseViewController = CreateCoursesViewController(); //pageViewController.GetNextViewController = GetNextViewController; //pageViewController.GetPreviousViewController = GetPreviousViewController; CoursePagerViewControllerDataSource dataSource = new CoursePagerViewControllerDataSource(courseManager); pageViewController.DataSource = dataSource; CourseViewController firstCourseViewController = dataSource.GetFirstViewController(); pageViewController.SetViewControllers(new UIViewController[] { firstCourseViewController }, UIPageViewControllerNavigationDirection.Forward, false, null); }
public UIPageViewControllerSpineLocation GetSpineLocation (UIPageViewController pageViewController, UIInterfaceOrientation orientation) { if (orientation == UIInterfaceOrientation.Portrait || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { UIViewController currentViewController = pageViewController.ViewControllers [0]; pageViewController.SetViewControllers ( new [] { currentViewController }, UIPageViewControllerNavigationDirection.Forward, true, null ); pageViewController.DoubleSided = false; return UIPageViewControllerSpineLocation.Min; } var dataViewController = (DataViewController)pageViewController.ViewControllers [0]; var indexOfCurrentViewController = modelController.IndexOfViewController (dataViewController); UIViewController[] viewControllers = null; if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0) { UIViewController nextViewController = modelController.GetNextViewController (pageViewController, dataViewController); viewControllers = new [] { dataViewController, nextViewController }; } else { UIViewController previousViewController = modelController.GetPreviousViewController (pageViewController, dataViewController); viewControllers = new[] { dataViewController, previousViewController }; } pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null); return UIPageViewControllerSpineLocation.Mid; }
public override void ViewDidLoad () { base.ViewDidLoad (); modelController = new ModelController (); pageViewController = new UIPageViewController ( UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, new NSDictionary () ); pageViewController.Delegate = this; DataViewController startingViewController = modelController.GetViewController (0, Storyboard); pageViewController.SetViewControllers ( new [] { startingViewController }, UIPageViewControllerNavigationDirection.Forward, false, null ); pageViewController.DataSource = modelController; AddChildViewController (pageViewController); View.AddSubview (pageViewController.View); CGRect pageViewRect = View.Bounds; pageViewController.View.Frame = pageViewRect; pageViewController.DidMoveToParentViewController (this); View.GestureRecognizers = pageViewController.GestureRecognizers; }
/// <summary> /// Handles loading the view. Override to perform any additional setup after loading the view. /// </summary> public override void ViewDidLoad() { base.ViewDidLoad(); // Handles the spacing between the pages. var values = new NSObject[] { NSNumber.FromFloat(4.0f) }; var keys = new NSObject[] { new NSString("UIPageViewControllerOptionInterPageSpacingKey") }; var options = NSDictionary.FromObjectsAndKeys(values, keys); var controllers = new List<UIViewController>() { new ParallaxItemViewController(new Flower() {ImagePath = "Images/Samples/Daffodils.jpg", Title="Daffodils", Subtitle="Narcissus"}), new ParallaxItemViewController(new Flower() {ImagePath = "Images/Samples/Orchids.jpg", Title="Orchids", Subtitle="Orchidaceae"}), new ParallaxItemViewController(new Flower() {ImagePath = "Images/Samples/Roses.jpg", Title="Roses", Subtitle="Rosa"}) }; // Init our pageviewer. pageController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, options); pageController.SetViewControllers(new UIViewController[] { controllers[0] }, UIPageViewControllerNavigationDirection.Forward, false, null); pageController.View.Frame = this.View.Bounds; pageController.DataSource = new PagingDataSource(controllers); // Hooks up the scrollview so we can parallax it. SetupParallax(); // Add the controls to the view. this.Add(this.pageController.View); // Create an offset - this is for debugging purposes only. debugOffset = new UILabel() { Frame = new RectangleF(10, 100, 300, 50), Text = "Offset = ", Font = Theme.FontOfSize(14f), TextColor = UIColor.White }; this.Add(debugOffset); }
public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = Theme.PrimaryNavigationBarColor; var welcomeViewController = new WelcomeViewController(); welcomeViewController.WantsToDimiss += OnWantsToDismiss; var pages = new UIViewController[] { new CardPageViewController(new AboutViewController()), new CardPageViewController(new PromoteView()), new CardPageViewController(new GoProViewController()), new CardPageViewController(new FeedbackViewController()), new CardPageViewController(welcomeViewController), }; var welcomePageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal); welcomePageViewController.DataSource = new PageDataSource(pages); welcomePageViewController.SetViewControllers(new [] { pages[0] }, UIPageViewControllerNavigationDirection.Forward, true, null); welcomePageViewController.View.Frame = new CoreGraphics.CGRect(0, 0, View.Frame.Width, View.Frame.Height); welcomePageViewController.View.AutoresizingMask = UIViewAutoresizing.All; AddChildViewController(welcomePageViewController); Add(welcomePageViewController.View); var nextButton = new UIButton(UIButtonType.Custom); nextButton.SetTitle("Next", UIControlState.Normal); nextButton.TintColor = UIColor.White; nextButton.TitleLabel.Font = UIFont.SystemFontOfSize(14f); nextButton.Frame = new CoreGraphics.CGRect(View.Frame.Width - 50f, View.Frame.Height - 28f, 40f, 20f); nextButton.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleTopMargin; Add(nextButton); var transitionAction = new Action<UIViewController>(e => { var isLast = pages.Last() == e; //nextButton.Enabled = !isLast; UIView.Transition(nextButton, 0.25f, UIViewAnimationOptions.TransitionCrossDissolve, () => nextButton.SetTitle(isLast ? "Done" : "Next", UIControlState.Normal), null); }); welcomePageViewController.WillTransition += (sender, e) => transitionAction(e.PendingViewControllers[0]); nextButton.TouchUpInside += (sender, e) => { var currentViewController = welcomePageViewController.ViewControllers[0]; var nextViewController = welcomePageViewController.DataSource.GetNextViewController(welcomePageViewController, currentViewController); if (nextViewController != null) { transitionAction(nextViewController); welcomePageViewController.SetViewControllers(new [] { nextViewController }, UIPageViewControllerNavigationDirection.Forward, true, null); } else { OnWantsToDismiss(); } }; }
public override UIViewController GetNextViewController (UIPageViewController pageViewController, UIViewController referenceViewController) { int index = IndexOf ((DataViewController)referenceViewController); if (index == -1 || index == pageData.Count - 1) return null; return GetViewController (index + 1, referenceViewController.Storyboard); }
/// <summary> /// Gets the previous view controller. /// </summary> /// <param name="pageViewController"></param> /// <param name="referenceViewController"></param> /// <returns></returns> public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var __c = pages.List.Find(referenceViewController); if (__c.Previous != null) return __c.Previous.Value; else return null; }
public override UIViewController GetPreviousViewController (UIPageViewController pageViewController, UIViewController referenceViewController) { int index = IndexOf ((DataViewController)referenceViewController); if (index == -1 || index == 0) return null; return GetViewController (index - 1, referenceViewController.Storyboard); }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var vc = (GettingStartedContentViewController)referenceViewController; var index = vc.PageIndex; if (index == 4) return null; return GettingStartedContentViewController.ControllerForPageIndex(index+1); }
public override UIViewController GetPreviousViewController (UIPageViewController pageViewController, UIViewController referenceViewController) { var vc = referenceViewController as ContentViewController; var index = vc.pageIndex; if (index == 0) { return null; } else { index--; return _parentViewController.ViewControllerAtIndex (index); } }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var index = Pages.IndexOf(referenceViewController) + 1; if (index >= Pages.Count) { //index = 0; return null; } return Pages.ElementAt(index); }
public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { if (referenceViewController is Page3ViewController) { return new Page2ViewController(_viewModel); } else if (referenceViewController is Page2ViewController) { return new Page1ViewController(_viewModel); } return null; }
public override UIViewController GetPreviousViewController( UIPageViewController pageViewController, UIViewController referenceViewController) { var index = Pages.IndexOf(referenceViewController) - 1; if (index < 0) { //index = (Pages.Count - 1); return null; } return Pages.ElementAt(index); }
public new nint GetPresentationIndex (UIPageViewController pageViewController) { var firstViewController = pageViewController.ViewControllers.FirstOrDefault () as DataItemViewController; if (firstViewController == null) throw new Exception ("Unexpected view controller type in page view controller."); for (int i = 0; i < dataItems.Length; i++) { if (firstViewController.DataItem == dataItems[i]) return i; } throw new Exception ("View controller's data item not found."); }
public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { CourseViewController returnCourseViewController = null; CourseViewController referenceCourseViewController = referenceViewController as CourseViewController; if (referenceViewController != null) { courseManager.MoveTo(referenceCourseViewController.CoursePosition); if (courseManager.CanMovePrev) { courseManager.MovePrev(); returnCourseViewController = CreateCoursesViewController(); } } return returnCourseViewController; }
public override void ViewDidLoad() { base.ViewDidLoad (); Paginacion PrimeraP = new Paginacion(0); ControladorVistas = new UIPageViewController (UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min); ControladorVistas.SetViewControllers (new UIViewController[]{PrimeraP}, UIPageViewControllerNavigationDirection.Forward, false, s => { }); ControladorVistas.GetNextViewController = this.SiguientePagina; ControladorVistas.GetPreviousViewController = this.PaginaPrevia; ControladorVistas.View.Frame = this.View.Bounds; this.View.AddSubview (this.ControladorVistas.View); }
public override void ViewDidLoad () { base.ViewDidLoad (); pageViewController = ChildViewControllers [0] as UIPageViewController; if (pageViewController == null) return; var startingViewController = DataSource.GetViewControllerAt (0); if (startingViewController == null) return; DataViewController[] viewControllers = { startingViewController }; pageViewController.SetViewControllers (viewControllers, Forward, false, null); pageViewController.DataSource = DataSource; pageViewController.DidMoveToParentViewController (this); }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { CourseViewController returnCourseViewController = null; CourseViewController referenceCourseViewController = referenceViewController as CourseViewController; if (referenceCourseViewController != null) { courseManager.MoveTo(referenceCourseViewController.CoursePosition); if (courseManager.CanMoveNext) { courseManager.MoveNext(); // create a CourseViewController at wahatever course is at that position returnCourseViewController = CreateCourseViewController(); } } return returnCourseViewController; }
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; }
public override void ViewDidLoad () { base.ViewDidLoad (); _pageTitles = new List<string> {"Explore", "Widget", "Navigation", "Random"}; _images = new List<string> {"page1", "page2", "page3", "page4"}; pageViewController = this.Storyboard.InstantiateViewController ("PageViewController") as UIPageViewController; pageViewController.DataSource = new PageViewControllerDataSource (this, _pageTitles); var startVC = this.ViewControllerAtIndex (0) as ContentViewController; var viewControllers = new UIViewController[] {startVC}; pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null); pageViewController.View.Frame = new CGRect (0, 0, this.View.Frame.Width, this.View.Frame.Size.Height-50); AddChildViewController (this.pageViewController); View.AddSubview (this.pageViewController.View); pageViewController.DidMoveToParentViewController (this); button.TouchUpInside += RestartTutorial; }
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 UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation) { UIViewController currentViewController; UIViewController[] viewControllers; if (orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { // In portrait orientation or on iPhone: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller. // Setting the spine position to 'UIPageViewControllerSpineLocation.Mid' in landscape orientation sets the doubleSided property to true, so set it to false here. currentViewController = pageViewController.ViewControllers [0]; viewControllers = new [] { currentViewController }; pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null); pageViewController.DoubleSided = false; return UIPageViewControllerSpineLocation.Min; } // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers. // If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers. currentViewController = pageViewController.ViewControllers [0]; int index = ModelController.IndexOf ((DataViewController)currentViewController); if (index == 0 || index % 2 == 0) { var nextViewController = ModelController.GetNextViewController (pageViewController, currentViewController); viewControllers = new [] { currentViewController, nextViewController }; } else { var previousViewController = ModelController.GetPreviousViewController (pageViewController, currentViewController); viewControllers = new [] { previousViewController, currentViewController }; } pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null); return UIPageViewControllerSpineLocation.Mid; }
public override void WillTransition(UIPageViewController pageViewController, UIViewController[] pendingViewControllers) { tabPageViewController.shouldScrollCurrentBar = true; tabPageViewController.tabView.scrollToHorizontalCenter(); // Order to prevent the the hit repeatedly during animation tabPageViewController.tabView.updateCollectionViewUserInteractionEnabled(false); }
protected void OnSetNativeControl() { pageController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.None, 0f); pageController.View.ClipsToBounds = true; pageController.WillTransition += PageController_WillTransition; pageController.DidFinishAnimating += PageController_DidFinishAnimating; SetNativeControl(pageController.View); }
/// <summary> /// Gets the spine location. /// </summary> /// <param name='pageController'>The book PageView controller.</param> /// <param name='orientation'>The device orientation.</param> /// <returns>The spine location.</returns> private UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation) { var currentPageVC = _GetCurrentPageVC(); pageViewController.DoubleSided = false; pageViewController.SetViewControllers(new UIViewController[] { currentPageVC }, UIPageViewControllerNavigationDirection.Forward, true, s => { }); return(UIPageViewControllerSpineLocation.Min); }
public override int GetPresentationCount(UIPageViewController pageViewController) { /*DukappPagedVC mp = m_parent as DukappPagedVC;*/ DukappPagedVC mp = pageViewController as DukappPagedVC; mp.setupPageControllerAppearance(); return(this.Pages); }
public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { index = Pages.IndexOf(referenceViewController); if (index > 0) { return(Pages[index - 1]); } return(null); }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { index = Pages.IndexOf(referenceViewController); if (index < Pages.Count - 1) { return(Pages[index + 1]); } return(null); }
public UIViewController GetNextViewController (UIPageViewController pageViewController, UIViewController referenceViewController) { nint index = IndexOfViewController ((DataViewController)referenceViewController); if (index == 0) return null; index--; return GetViewController (index, referenceViewController.Storyboard); }
public void DidFinishAnimating(UIPageViewController pageViewController, bool finished, UIViewController[] previousViewControllers, bool completed) { if (completed) { UpdateOverlayInformation(); var photoViewController = pageViewController.ViewControllers[0]; DidNavigateToPhoto(((IDNAPhotoContainer)photoViewController).Photo); } }
public override void DidFinishAnimating(UIPageViewController pageViewController, bool finished, UIViewController[] previousViewControllers, bool completed) { if (tabPageViewController.currentIndex.HasValue && tabPageViewController.currentIndex < tabPageViewController.tabItemCount) { tabPageViewController.tabView.updateCurrentIndex((int)tabPageViewController.currentIndex, shouldScroll: false); tabPageViewController.beforeIndex = tabPageViewController.currentIndex.Value; } tabPageViewController.tabView.updateCollectionViewUserInteractionEnabled(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); const int buttonHeight = 50; var pagerSurload = new UIPageControl { Frame = new CGRect(0, UIScreen.MainScreen.Bounds.Height - buttonHeight - buttonHeight, UIScreen.MainScreen.Bounds.Width, buttonHeight), Pages = 4 }; var pvController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal); var pages = new List <StartupPageFeatureViewController>(); int index = 0; pages.Add(new StartupPageFeatureViewController( Core.Resources.StringValues.Startup_FlipViewItem1_Title_Text, Core.Resources.StringValues.Startup_FlipViewItem1_Content_Text, index++)); pages.Add(new StartupPageFeatureViewController( Core.Resources.StringValues.Startup_FlipViewItem2_Title_Text, Core.Resources.StringValues.Startup_FlipViewItem2_Content_Text, index++)); pages.Add(new StartupPageFeatureViewController( Core.Resources.StringValues.Startup_FlipViewItem3_Title_Text, Core.Resources.StringValues.Startup_FlipViewItem3_Content_Text, index++)); pages.Add(new StartupPageFeatureViewController( Core.Resources.StringValues.Startup_FlipViewItem4_Title_Text, Core.Resources.StringValues.Startup_FlipViewItem4_Content_Text, index++)); pvController.DataSource = new PageDataSource(pages, pagerSurload); pvController.View.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height - buttonHeight); pvController.SetViewControllers(new UIViewController[] { pages[0], }, UIPageViewControllerNavigationDirection.Forward, false, s => { }); AddChildViewController(pvController); View.AddSubview(pvController.View); pvController.DidMoveToParentViewController(this); View.AddSubview(pagerSurload); var connectButton = new UIButton { Frame = new CGRect(0, UIScreen.MainScreen.Bounds.Height - buttonHeight, UIScreen.MainScreen.Bounds.Width, buttonHeight), BackgroundColor = ApplicationColors.MainColor }; connectButton.SetTitle(Core.Resources.StringValues.Startup_ConnectionButton_Text, UIControlState.Normal); View.AddSubview(connectButton); connectButton.SetCommand(ViewModel.GoToNextPageCommand); }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var currentPage = referenceViewController as PageForPageController; if (currentPage.Next != null) { return(currentPage.Next); } return(null); }
override public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var itemController = referenceViewController as PageItemViewController; if (itemController.Index + 1 < controller.contentImages.Count) { return(controller.GetItemController(itemController.Index + 1)); } return(null); }
public UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var index = ViewControllers.IndexOf(referenceViewController) - 1; if (index < 0) { return(null); } return(ViewControllers[index]); }
public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var index = ViewControllers.IndexOf(referenceViewController) + 1; if (index == ViewControllers.Count) { return(null); } return(ViewControllers[index]); }
override public UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var currentIndex = this.children.IndexOf(referenceViewController); if (currentIndex == 0) { return(null); } currentIndex--; return(this.children[currentIndex]); }
override public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var currentIndex = this.children.IndexOf(referenceViewController); if (currentIndex >= this.children.Count - 1) { return(null); } currentIndex++; return(this.children[currentIndex]); }
public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var currentPage = referenceViewController as PageForPageController; if (currentPage.Previous != null) { return(currentPage.Previous); } return(null); }
//返回后一个 public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { int index = Array.FindIndex(Controllers, x => x == referenceViewController); if (index == (Controllers.Length - 1)) { return(null); } index++; return(Controllers[index]); }
override public UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var currentPage = referenceViewController as PageItemViewController; if (currentPage.Index > 0) { return(controller.GetItemController(currentPage.Index - 1)); } return(null); }
public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { int index = IndexOf((DataViewController)referenceViewController); if (index == -1 || index == 0) { return(null); } return(GetViewController(index - 1, referenceViewController.Storyboard)); }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { int index = IndexOf((DataViewController)referenceViewController); if (index == -1 || index == pageData.Count - 1) { return(null); } return(GetViewController(index + 1, referenceViewController.Storyboard)); }
public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var photoIndex = DataSource.IndexOfPhoto(((IDNAPhotoContainer)referenceViewController).Photo); if (photoIndex == -1) { return(null); } return(NewPhotoViewController(DataSource.PhotoAtIndex(photoIndex + 1))); }
//返回前一个 public UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { int index = Array.FindIndex(Controllers, x => x == referenceViewController); //如果是第一个页面 if (index == 0) { return(null); } index--; return(Controllers[index]); }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var index = Pages.IndexOf(referenceViewController) + 1; if (index >= Pages.Count) { //index = 0; return(null); } return(Pages.ElementAt(index)); }
public override UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var current = _pages.FindIndex(vc => vc.GetType() == referenceViewController.GetType()); var previous = current - 1; if (previous < 0) { previous = _pages.Count - 1; } return(_pages[previous]); }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var vc = (GettingStartedContentViewController)referenceViewController; var index = vc.PageIndex; if (index == 4) { return(null); } return(GettingStartedContentViewController.ControllerForPageIndex(index + 1)); }
public override void DidFinishAnimating(UIPageViewController pageViewController, bool finished, UIViewController[] previousViewControllers, bool completed) { if (completed) { var contentViewController = pageViewController.ViewControllers[0] as WalkthroughContentViewController; if (contentViewController != null) { _walkthroughPageViewController.CurrentIndex = contentViewController.Index; _updateIndexDelegate(); } } }
private UIViewController getPreviousPageViewController(UIPageViewController pageController, UIViewController referenceViewController) { var curPageCntr = referenceViewController as PageVC; if (curPageCntr.PageNumber == 0) { return(null); } nint pageNumber = curPageCntr.PageNumber - 1; return(getPageViewController(pageNumber)); }
override public UIViewController GetPreviousViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var currentPage = referenceViewController as StartupPageFeatureViewController; _pageControl.CurrentPage = currentPage.PageIndex; if (currentPage.PageIndex <= 0) { return(null); } return(_pages[currentPage.PageIndex - 1]); }
public override UIViewController GetNextViewController (UIPageViewController pageViewController, UIViewController referenceViewController) { var vc = referenceViewController as ContentViewController; var index = vc.pageIndex; index++; if (index == _pageTitles.Count) { return null; } else { return _parentViewController.ViewControllerAtIndex (index); } }
public override UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { var current = _pages.FindIndex(vc => vc.GetType() == referenceViewController.GetType()); var next = current + 1; if (next >= _pages.Count) { next = 0; } return(_pages[next]); }
public UIViewController GetNextViewController(UIPageViewController pageViewController, UIViewController referenceViewController) { nint index = IndexOfViewController((DataViewController)referenceViewController); if (index == 0) { return(null); } index--; return(GetViewController(index, referenceViewController.Storyboard)); }
public UIViewController GetPreviousViewController (UIPageViewController pageViewController, UIViewController referenceViewController) { nint index = IndexOfViewController ((DataViewController)referenceViewController); if (index == 0) return null; index++; if (index == numberOfPages) return null; return GetViewController (index, referenceViewController.Storyboard); }
public override void ViewDidLoad() { base.ViewDidLoad(); // ios7 layout if (RespondsToSelector(new Selector("edgesForExtendedLayout"))) EdgesForExtendedLayout = UIRectEdge.None; _pageController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.None); _pageController.SetViewControllers(new UIViewController[] { new Page1ViewController(base.ViewModel) }, UIPageViewControllerNavigationDirection.Forward, false, null); _pageController.DataSource = new PageDataSource(base.ViewModel); _pageController.View.Frame = this.View.Bounds; this.View.AddSubview(_pageController.View); }
private UIViewController PaginaPrevia(UIPageViewController controlador, UIViewController Controladorbase) { Paginacion PaginaActual = Controladorbase as Paginacion; if (PaginaActual.Indice <+ 0) { return null; }else { int paginaPrevia = PaginaActual.Indice - 1; return new Paginacion(paginaPrevia); } }
private UIViewController SiguientePagina(UIPageViewController controlador, UIViewController Controladorbase) { Paginacion PaginaActual = Controladorbase as Paginacion; if (PaginaActual.Indice >= (this.ContadorPag - 1)) { return null; }else { int siguiente = PaginaActual.Indice + 1; return new Paginacion(siguiente); } }
public override void ViewDidLoad () { base.ViewDidLoad (); this._pageViewController = new UIPageViewController (UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min); this._pageViewController.DataSource = new PageDataSource (this); this._pageViewController.DidFinishAnimating += delegate(object sender, UIPageViewFinishedAnimationEventArgs e) { if (e.Completed) { //_pageControl.CurrentPage = this.CurrentPage; this.CurrentPage = ((PageDataSource)this._pageViewController.DataSource).CurrentPage; } }; this._pageViewController.GetSpineLocation = GetSpineLocation; this._pageViewController.View.Frame = this.View.Bounds; this.View.AddSubview (this._pageViewController.View); View.AddSubview (_pageControl); }