コード例 #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
            };
        }
コード例 #2
0
ファイル: SplitViewContoller.cs プロジェクト: omxeliw/recipes
        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
            };
        }