ToggleMenu() public method

Toggles the menu open or closed.
public ToggleMenu ( ) : void
return void
        private static UIBarButtonItem CreateBarButtonItem(SidebarController sidebarController, IMvxSidebarMenu mvxSidebarMenu = null)
        {
            UIBarButtonItem barButtonItem;

            if (mvxSidebarMenu != null)
            {
                barButtonItem = new UIBarButtonItem(mvxSidebarMenu.MenuButtonImage
                    , UIBarButtonItemStyle.Plain
                    , (sender, args) =>
                    {
                        sidebarController.MenuWidth = mvxSidebarMenu.MenuWidth;
                        sidebarController.ViewWillAppear(false);
                        sidebarController.ToggleMenu();
                    });
            }
            else
            {
                barButtonItem = new UIBarButtonItem("Menu"
                    , UIBarButtonItemStyle.Plain
                    , (sender, args) =>
                    {
                        sidebarController.ToggleMenu();
                    });
            }

            return barButtonItem;
        }
        partial void BtnMenu_Activated(UIBarButtonItem sender)
        {
            var introController = (ViewController_Home)Storyboard.InstantiateViewController("ViewController_Home");
            var menuController  = (ViewController_Menu)Storyboard.InstantiateViewController("ViewController_Menu");

            SidebarController                = new SidebarNavigation.SidebarController(this, introController, menuController);
            SidebarController.MenuWidth      = 220;
            SidebarController.ReopenOnRotate = false;
            SidebarController.MenuLocation   = SidebarController.MenuLocations.Left;

            //if (SidebarController.IsOpen == false)
            //{
            SidebarController.ToggleMenu();
        }
Exemplo n.º 3
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     customnav = new TSCustomNavController();
     //if (UserInterfaceIsPhone)
     customnav.PushViewController(new TSSettingsView(), false);
     //else
     //	customnav.PushViewController (new TSSplitVCIPad (), false);
     SidebarController = new SidebarNavigation.SidebarController(this, customnav, new TSLeftSideMenuController());
     SidebarController.MenuLocation      = SidebarNavigation.SidebarController.MenuLocations.Left;
     SidebarController.FlingVelocity     = 300f;
     SidebarController.MenuWidth         = (int)TSPhoneSpec.MenuWidth;
     customnav.MenuButton.TouchUpInside += (sender, e) => {
         SidebarController.ToggleMenu();
     };
 }
Exemplo n.º 4
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad ();
     customnav = new TSCustomNavController ();
     //if (UserInterfaceIsPhone)
     customnav.PushViewController (new TSLoginVC (), false);
     //else
     //				customnav.PushViewController (new TSSplitVCIPad (), false);
     SidebarController = new SidebarNavigation.SidebarController(this, customnav, new TSLeftSideMenuController ());
     SidebarController.MenuLocation = SidebarNavigation.SidebarController.MenuLocations.Left;
     SidebarController.FlingVelocity = 300f;
     SidebarController.MenuWidth = (int)TSPhoneSpec.MenuWidth;
     customnav.MenuButton.TouchUpInside += (sender, e) => {
         SidebarController.ToggleMenu ();
     };
 }