public DNAPhotosViewController(IDNAPhotoViewerDataSource dataSource, NSPhoto initialPhoto = null, IDNAPhotosViewControllerDelegate _delegate = null) { if (initialPhoto == null) { initialPhoto = dataSource.PhotoAtIndex(0); } Initialize(dataSource, initialPhoto, _delegate); }
void Initialize(IDNAPhotoViewerDataSource dataSource, NSPhoto initialPhoto, IDNAPhotosViewControllerDelegate _delegate = null) { DataSource = dataSource; Delegate = _delegate; InitialPhoto = initialPhoto; PanGestureRecognizer = new UIPanGestureRecognizer(this, new Selector("didPanWithGestureRecognizer:")); SingleTapGestureRecognizer = new UITapGestureRecognizer(this, new Selector("didSingleTapWithGestureRecognizer:")); TransitionController = new DNAPhotoTransitionController(); ModalPresentationStyle = UIModalPresentationStyle.Custom; TransitioningDelegate = TransitionController; ModalPresentationCapturesStatusBarAppearance = true; OverlayView = SetUpOverlayView(); _notificationCenter = new NSNotificationCenter(); PageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, new NSDictionary()); PageViewController.Delegate = this; PageViewController.DataSource = this; }
public DNAPhotosViewController(IDNAPhotoViewerDataSource dataSource, int initialPhotoIndex, IDNAPhotosViewControllerDelegate _delegate = null) { var initialPhoto = dataSource.PhotoAtIndex(initialPhotoIndex); Initialize(dataSource, initialPhoto, _delegate); }