示例#1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.FromRGB(.4f, .4f, .4f);

            UILabel title = new UILabel(new CGRect(0, 50, 270, 20));

            title.Font          = UIFont.SystemFontOfSize(24.0f);
            title.TextAlignment = UITextAlignment.Center;
            title.TextColor     = UIColor.FromRGB(191, 222, 227);
            title.Text          = "Menu";
            title.Font          = UIFont.FromName("Orange Kid", 34f);

            UIButton introButton = new UIButton(UIButtonType.System);

            introButton.Frame = new CGRect(0, 180, 260, 20);
            introButton.SetTitle("Reset Canvas", UIControlState.Normal);
            introButton.TouchUpInside += (sender, e) =>
                                         SidebarController.ChangeContentView(new IntroController());
            introButton.SetTitleColor(UIColor.FromRGB(191, 222, 227), UIControlState.Normal);
            introButton.Font = UIFont.FromName("Orange Kid", 28f);

            UIButton testButton = new UIButton(UIButtonType.System);

            testButton.Frame = new CGRect(0, 220, 260, 20);
            testButton.SetTitle("Plain Code", UIControlState.Normal);
            testButton.TouchUpInside += (sender, e) =>
                                        SidebarController.ChangeContentView(new PlainCodeController());
            testButton.SetTitleColor(UIColor.FromRGB(191, 222, 227), UIControlState.Normal);
            testButton.Font = UIFont.FromName("Orange Kid", 28f);

            UIButton instructionsButton = new UIButton(UIButtonType.System);

            instructionsButton.Frame = new CGRect(0, 260, 260, 20);
            instructionsButton.SetTitle("Instructions", UIControlState.Normal);
            instructionsButton.TouchUpInside += (sender, e) =>
                                                SidebarController.ChangeContentView(new InstructionsController());
            instructionsButton.SetTitleColor(UIColor.FromRGB(191, 222, 227), UIControlState.Normal);
            instructionsButton.Font = UIFont.FromName("Orange Kid", 28f);

            UIButton aboutButton = new UIButton(UIButtonType.System);

            aboutButton.Frame = new CGRect(0, 300, 260, 20);
            aboutButton.SetTitle("About", UIControlState.Normal);
            aboutButton.TouchUpInside += (sender, e) =>
                                         SidebarController.ChangeContentView(new AboutController());
            aboutButton.SetTitleColor(UIColor.FromRGB(191, 222, 227), UIControlState.Normal);
            aboutButton.Font = UIFont.FromName("Orange Kid", 28f);

            View.Add(title);
            View.Add(introButton);
            View.Add(testButton);
            View.Add(instructionsButton);
            View.Add(aboutButton);
        }
示例#2
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;
            }
        }
示例#3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.FromRGB(.9f, .9f, .9f);

            var title = new UILabel(new RectangleF(0, 50, 270, 20));

            title.Font          = UIFont.SystemFontOfSize(24.0f);
            title.TextAlignment = UITextAlignment.Center;
            title.TextColor     = UIColor.Blue;
            title.Text          = "Menu";

            var body = new UILabel(new RectangleF(30, 70, 200, 100));

            body.Font          = UIFont.SystemFontOfSize(12.0f);
            body.TextAlignment = UITextAlignment.Center;
            body.Lines         = 0;
            body.Text          = @"This is the side menu. You can use any UIViewController to put whatever you want here!";

            var introButton = new UIButton(UIButtonType.System);

            introButton.Frame = new RectangleF(0, 180, 260, 20);
            introButton.SetTitle("Intro", UIControlState.Normal);
            introButton.TouchUpInside += (sender, e) => {
                SidebarController.ChangeContentView(new IntroController());
            };

            var contentButton = new UIButton(UIButtonType.System);

            contentButton.Frame = new RectangleF(0, 220, 260, 20);
            contentButton.SetTitle("Content", UIControlState.Normal);
            contentButton.TouchUpInside += (sender, e) => {
                SidebarController.ChangeContentView(new ContentController());
            };

            var subMenuButton = new UIButton(UIButtonType.System);

            subMenuButton.Frame = new RectangleF(0, 260, 260, 20);
            subMenuButton.SetTitle("Sub Menu", UIControlState.Normal);
            subMenuButton.TouchUpInside += (sender, e) => {
                SidebarController.ChangeMenuView(new SubMenuController());
            };

            View.Add(title);
            View.Add(body);
            View.Add(introButton);
            View.Add(contentButton);
            View.Add(subMenuButton);
        }