Exemplo n.º 1
0
        public void ChangeContentView(int contentId)
        {
            switch (contentId)
            {
            case 0:
                // Exception
                HomeViewController standardViewController = (HomeViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("HomeViewController");
                SidebarController.ChangeContentView(new CustomNavController(standardViewController));
                break;

            case 1:
                // Dashboard
                HomeViewController homeViewController = (HomeViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("HomeViewController");
                SidebarController.ChangeContentView(new CustomNavController(homeViewController));
                break;

            case 2:
                // Outlet List
                OutletListViewController outletViewController = (OutletListViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("OutletListViewController");
                SidebarController.ChangeContentView(new CustomNavController(outletViewController));
                break;

            case 3:
                // UOM
                UOMViewController uomViewController = (UOMViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("UOMViewController");
                SidebarController.ChangeContentView(new CustomNavController(uomViewController));
                break;

            case 4:
                // Synchronization
                SyncViewController syncViewController = (SyncViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("SyncViewController");
                SidebarController.ChangeContentView(new CustomNavController(syncViewController));
                break;

            case 5:
                // About
                AboutViewController aboutViewController = (AboutViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("AboutViewController");
                SidebarController.ChangeContentView(new CustomNavController(aboutViewController));
                break;

            case 6:
                // LogOut

                break;

            default:
                HomeViewController defaultViewController = (HomeViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("HomeViewController");
                SidebarController.ChangeContentView(new CustomNavController(defaultViewController));
                break;
            }
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            CGRect bounds = UIScreen.MainScreen.Bounds;

            if (this.NavigationController != null)
            {
                this.NavigationController.SetNavigationBarHidden(true, false);
            }

            SideMenuViewController menuViewController = (SideMenuViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("SideMenuViewController");
            HomeViewController     homeViewController = (HomeViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("HomeViewController");

            CustomNavController navController = new CustomNavController(homeViewController);

            SidebarController = new SidebarController(this, navController, menuViewController);
            SidebarController.MenuLocation = SidebarNavigation.SidebarController.MenuLocations.Left;
            SidebarController.MenuWidth    = (int)bounds.Size.Width - 56;
        }