public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Create the flyout view controller, make it large,
            // and add it as a subview:
            navigation            = new FlyOutNavigationController();
            navigation.View.Frame = UIScreen.MainScreen.Bounds;
            View.AddSubview(navigation.View);

            // Create the menu:
            navigation.NavigationRoot = new RootElement("Task List")
            {
                new Section("Task List")
                {
                    from page in Tasks
                         select new StringElement(page) as Element
                }
            };

            // Create an array of UINavigationControllers that correspond to your
            // menu items:
            navigation.ViewControllers = Array.ConvertAll(Tasks, title =>
                                                          new UINavigationController(new TaskPageController(navigation, title))
                                                          );
        }
 public TaskPageController(FlyOutNavigationController navigation, string title) : base(null)
 {
     Root = new RootElement(title)
     {
         new Section {
             new CheckboxElement(title)
         }
     };
     NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Action, delegate {
         navigation.ToggleMenu();
     });
 }
Пример #3
0
 public BaseDialogViewController(FlyOutNavigationController navigation, RootElement root) : base(root)
 {
     this.navigation = navigation;
 }
Пример #4
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            viewController = new FlyOutNavigationController();
            viewController.NavigationRoot = new RootElement("")
            {
                new Section("Section 1")
                {
                    new StringElement("View 1"),
                    new ImageStringElement("View 2", UIImage.FromFile("jhill.jpeg")),
                    new StringElement("View 3"),
                },
                new Section("Section 2")
                {
                    new StringElement("View 1"),
                    new StringElement("View 2"),
                }
            };
            viewController.ViewControllers = new UIViewController[] {
                new UINavigationController(new BaseDialogViewController(viewController, new RootElement("Section 1")
                {
                    new Section()
                    {
                        new StringElement("View 1")
                    }
                }))
                , new UINavigationController(new BaseDialogViewController(viewController, new RootElement("Section 1")
                {
                    new Section()
                    {
                        new StringElement("View 2")
                    }
                }))
                , new UINavigationController(new BaseDialogViewController(viewController, new RootElement("Section 1")
                {
                    new Section()
                    {
                        new StringElement("View 3")
                    }
                }))
                , new UINavigationController(new BaseDialogViewController(viewController, new RootElement("Section 2")
                {
                    new Section()
                    {
                        new StringElement("View 1")
                    }
                }))
                , new UINavigationController(new BaseDialogViewController(viewController, new RootElement("Section 2")
                {
                    new Section()
                    {
                        new StringElement("View 2")
                    }
                }))
            };
            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            return(true);
        }