Exemplo n.º 1
0
        public SplitViewContoller() : base()
        {
            sd       = new SplitDelegate();
            Delegate = sd;

            colorsController = new ColorsController();

            redVC = new UIViewController();
            redVC.View.BackgroundColor = UIColor.Red;

            colorsController.ColorSelected += (sender, e) => {
                if (e.Color == "Red")
                {
                    detailContainer = redVC;
                }
                else if (e.Color == "Green")
                {
                    if (greenVC == null)
                    {
                        greenVC = new UIViewController();
                        greenVC.View.BackgroundColor = UIColor.Green;
                    }
                    detailContainer = greenVC;
                }

                ViewControllers = new UIViewController[] {
                    colorsController,
                    detailContainer
                };
            };

            detailContainer = redVC;

            ViewControllers = new UIViewController[] {
                colorsController,
                detailContainer
            };
        }
Exemplo n.º 2
0
        public SplitViewContoller()
            : base()
        {
            sd = new SplitDelegate ();
            Delegate = sd;

            colorsController = new ColorsController ();

            redVC = new UIViewController ();
            redVC.View.BackgroundColor = UIColor.Red;

            colorsController.ColorSelected += (sender, e) => {

                if (e.Color == "Red") {

                    detailContainer = redVC;

                } else if (e.Color == "Green") {
                    if (greenVC == null) {
                        greenVC = new UIViewController ();
                        greenVC.View.BackgroundColor = UIColor.Green;
                    }
                    detailContainer = greenVC;
                }

                ViewControllers = new UIViewController[] {
                    colorsController,
                    detailContainer
                };
            };

            detailContainer = redVC;

            ViewControllers = new UIViewController[] {
                colorsController,
                detailContainer
            };
        }