Exemplo n.º 1
0
 public void WillPresentViewController(object sender, UISplitViewPresentEventArgs args)
 {
     if (BarButtonItemPopover.PopoverVisible)
     {
         BarButtonItemPopover.Dismiss(true);
     }
 }
Exemplo n.º 2
0
        public void ShowPopoverFromBarButtonItem(NSObject sender)
        {
            // Set the sender to a UIBarButtonItem.
            UIBarButtonItem tappedButton = (UIBarButtonItem)sender;

            // If the master list popover is showing, dismiss it before presenting the popover from the bar button item.
            if (MainPopoverController != null)
            {
                MainPopoverController.Dismiss(true);
            }

            // If the popover is already showing from the bar button item, dismiss it. Otherwise, present it.
            if (!BarButtonItemPopover.PopoverVisible)
            {
                BarButtonItemPopover.PresentFromBarButtonItem(tappedButton, UIPopoverArrowDirection.Any, true);
            }
            else
            {
                BarButtonItemPopover.Dismiss(true);
            }
        }