Ejemplo n.º 1
0
        public void MenuPopOverRowSelected(JVMenuPopoverView sender, NSIndexPath indexPath)
        {
            CloseMenuFromController(null);

            JVMenuItem selItem = null;

            if (indexPath.Row < MenuItems.Count)
            {
                selItem = MenuItems[indexPath.Row];
            }

            if (this.Delegate != null)
            {
                if (selItem != null &&
                    (selItem is JVMenuViewControllerItem ||
                     selItem is JVMenuActionItem))
                {
                    if (this.NavController is UINavigationController)
                    {
                        this.Delegate.DidPickItem((UINavigationController)this.NavController, selItem);
                    }


                    return;
                }


                if (this.NavController is UINavigationController)
                {
                    this.Delegate.SetNewViewController((UINavigationController)this.NavController, indexPath);
                }
            }
            else
            {
                if (selItem != null)
                {
                    if (selItem is JVMenuActionItem &&
                        ((JVMenuActionItem)selItem).Command != null)
                    {
                        this.BeginInvokeOnMainThread(((JVMenuActionItem)selItem).Command);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Did pick the item
        /// </summary>
        /// <param name="item">Item.</param>
        public virtual void DidPickItem(UINavigationController navController, JVMenuItem item)
        {
            if (item is JVMenuActionItem &&
                ((JVMenuActionItem)item).Command != null)
            {
                this.BeginInvokeOnMainThread(((JVMenuActionItem)item).Command);
            }
            else if (item is JVMenuViewControllerItem &&
                     ((JVMenuViewControllerItem)item).HasViewController)
            {
                var aVC = ((JVMenuViewControllerItem)item).ViewController;

                if (aVC != menuController.CurrentController)
                {
                    aVC.View.Transform            = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), 0.6f, 0.6f);
                    navController.ViewControllers = new UIViewController[] { aVC };
                }
            }
        }