Inheritance: UIViewController
Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
		public nint IndexOfViewController (DataViewController viewController)
		{
			return viewController.PageNumber - 1;
		}
Exemplo n.º 3
0
 public nint IndexOfViewController(DataViewController viewController)
 {
     return(viewController.PageNumber - 1);
 }
Exemplo n.º 4
0
 public nint IndexOfViewController(DataViewController viewController)
 {
     // Return the index of the given data view controller.
     // For simplicity, this implementation uses a static array of model objects and the view controller stores the model object; you can therefore use the model object to identify the index.
     return(viewController.PageNumber - 1);
 }