Beispiel #1
0
        void HandleCollectionMenuButtonTouchUpInside()
        {
            HidePopover();

            if (collectionViewController == null)
            {
                PopoverCollectionController pcc = new PopoverCollectionController();
                pcc.Title             = "Menu";
                pcc.RowSelectedEvent += HandleCollectionMenuButtonEvent;

                UINavigationController navController = new UINavigationController();
                navController.SetViewControllers(new UIViewController[] { pcc }, true);
                navController.View.Frame = new CGRect(0, 0, 280, 44 * 6 + 20);

                collectionViewController = new UIPopoverController(navController);
                collectionViewController.SetPopoverContentSize(new CGSize(navController.View.Frame.Width, navController.View.Frame.Height), true);
                collectionViewController.PresentFromBarButtonItem(CollectionMenuItem, UIPopoverArrowDirection.Any, true);
                collectionViewController.DidDismiss += delegate
                {
                    collectionViewController = null;
                };
            }
            else
            {
                collectionViewController.Dismiss(true);
                collectionViewController = null;
            }
        }
Beispiel #2
0
 public PopoverCollectioneDataSource(PopoverCollectionController parent)
 {
     this.parent = parent;
 }