Esempio n. 1
0
        void UpdateControllers()
        {
            FlyoutPage.Flyout.PropertyChanged -= HandleFlyoutPropertyChanged;

            if (Platform.GetRenderer(FlyoutPage.Flyout) == null)
            {
                Platform.SetRenderer(FlyoutPage.Flyout, Platform.CreateRenderer(FlyoutPage.Flyout));
            }
            if (Platform.GetRenderer(FlyoutPage.Detail) == null)
            {
                Platform.SetRenderer(FlyoutPage.Detail, Platform.CreateRenderer(FlyoutPage.Detail));
            }

            ClearControllers();

            FlyoutPage.Flyout.PropertyChanged += HandleFlyoutPropertyChanged;

            var flyout = Platform.GetRenderer(FlyoutPage.Flyout).ViewController;
            var detail = Platform.GetRenderer(FlyoutPage.Detail).ViewController;

            _flyoutController.View.AddSubview(flyout.View);
            _flyoutController.AddChildViewController(flyout);

            _detailController.View.AddSubview(detail.View);
            _detailController.AddChildViewController(detail);
        }
        void UpdateControllers()
        {
            MasterDetailPage.Master.PropertyChanged -= HandleMasterPropertyChanged;

            if (Platform.GetRenderer(MasterDetailPage.Master) == null)
            {
                Platform.SetRenderer(MasterDetailPage.Master, Platform.CreateRenderer(MasterDetailPage.Master));
            }
            if (Platform.GetRenderer(MasterDetailPage.Detail) == null)
            {
                Platform.SetRenderer(MasterDetailPage.Detail, Platform.CreateRenderer(MasterDetailPage.Detail));
            }

            ClearControllers();

            MasterDetailPage.Master.PropertyChanged += HandleMasterPropertyChanged;

            var master = Platform.GetRenderer(MasterDetailPage.Master).ViewController;
            var detail = Platform.GetRenderer(MasterDetailPage.Detail).ViewController;

            _masterController.View.AddSubview(master.View);
            _masterController.AddChildViewController(master);

            _detailController.View.AddSubview(detail.View);
            _detailController.AddChildViewController(detail);
        }