예제 #1
0
        public SplitViewContoller() : base()
        {
            // create our master and detail views
            masterView = new MasterViewController();
            detailView = new DetailViewController();

            ViewControllers = new UIViewController[]
            { masterView, detailView };                     // order is important: master first, detail second

            Delegate = new SplitViewDelegate();
        }
예제 #2
0
        public SplitViewContoller()
            : base()
        {
            // create our master and detail views
            masterView = new MasterViewController ();
            detailView = new DetailViewController ();

            ViewControllers = new UIViewController[]
                { masterView, detailView }; // order is important: master first, detail second

            Delegate = new SplitViewDelegate();
        }
예제 #3
0
        public SplitViewContoller() : base()
        {
            // create our master and detail views
            masterView = new MasterViewController();
            detailView = new DetailViewController();

            // create an array of controllers from them and then assign it to the
            // controllers property
            ViewControllers = new UIViewController[]
            { masterView, detailView };                     // order is important: master first, detail second

            #region Additional Information
            // for iOS5 only, we can force the master view to ALWAYS be visible, even in portrait
//			ShouldHideViewController = (svc, viewController, inOrientation) => {
//				return false; // default behaviour is true
//			};
            #endregion
        }
예제 #4
0
        public SplitViewContoller()
            : base()
        {
            // create our master and detail views
            masterView = new MasterViewController ();
            detailView = new DetailViewController ();

            // create an array of controllers from them and then assign it to the
            // controllers property
            ViewControllers = new UIViewController[]
                { masterView, detailView }; // order is important: master first, detail second

            #region Additional Information
            // for iOS5 only, we can force the master view to ALWAYS be visible, even in portrait
            //			ShouldHideViewController = (svc, viewController, inOrientation) => {
            //				return false; // default behaviour is true
            //			};
            #endregion
        }
예제 #5
0
        public SplitViewContoller() : base()
        {
            // create our master and detail views
            masterView = new MasterViewController();
            detailView = new DetailViewController();

            // create an array of controllers from them and then assign it to the
            // controllers property
            ViewControllers = new UIViewController[]
            { masterView, detailView };                     // order is important: master first, detail second


            // in this example, i expose an event on the master view called RowClicked, and i listen
            // for it in here, and then call a method on the detail view to update. this class thereby
            // becomes the defacto controller for the screen (both views).
            masterView.RowClicked += (object sender, MasterViewController.RowClickedEventArgs e) => {
                detailView.Update(e.Item);
            };


            // when the master view controller is hidden (portrait mode), we add a button to
            // the detail view that will show the master view in a popover
            WillHideViewController += (object sender, UISplitViewHideEventArgs e) => {
                detailView.Popover = e.Pc;
                detailView.AddContentsButton(e.BarButtonItem);
            };

            // when the master view controller is shown (landscape mode), remove the button
            WillShowViewController += (object sender, UISplitViewShowEventArgs e) => {
                detailView.Popover = null;
                detailView.RemoveContentsButton();
            };

            // hide the master view controller
            ShouldHideViewController = (svc, viewController, inOrientation) => {
                return(inOrientation == UIInterfaceOrientation.Portrait ||
                       inOrientation == UIInterfaceOrientation.PortraitUpsideDown);
            };
        }
예제 #6
0
        public SplitViewContoller()
            : base()
        {
            // create our master and detail views
            masterView = new MasterViewController ();
            detailView = new DetailViewController ();

            // create an array of controllers from them and then assign it to the
            // controllers property
            ViewControllers = new UIViewController[]
                { masterView, detailView }; // order is important: master first, detail second

            // in this example, i expose an event on the master view called RowClicked, and i listen
            // for it in here, and then call a method on the detail view to update. this class thereby
            // becomes the defacto controller for the screen (both views).
            masterView.RowClicked += (object sender, MasterViewController.RowClickedEventArgs e) => {
                detailView.Update (e.Item);
            };

            // when the master view controller is hidden (portrait mode), we add a button to
            // the detail view that will show the master view in a popover
            WillHideViewController += (object sender, UISplitViewHideEventArgs e) => {
                detailView.Popover = e.Pc;
                detailView.AddContentsButton(e.BarButtonItem);
            };

            // when the master view controller is shown (landscape mode), remove the button
            WillShowViewController += (object sender, UISplitViewShowEventArgs e) => {
                detailView.Popover = null;
                detailView.RemoveContentsButton ();
            };

            // hide the master view controller
            ShouldHideViewController = (svc, viewController, inOrientation) => {
                return inOrientation == UIInterfaceOrientation.Portrait ||
                    inOrientation == UIInterfaceOrientation.PortraitUpsideDown;
            };
        }
예제 #7
0
            public override void WillShowViewController(UISplitViewController svc, UIViewController aViewController, UIBarButtonItem button)
            {
                DetailViewController detailView = svc.ViewControllers[1] as DetailViewController;

                detailView.RemoveContentsButton();
            }
예제 #8
0
            public override void WillHideViewController(UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
            {
                DetailViewController detailView = svc.ViewControllers[1] as DetailViewController;

                detailView.AddContentsButton(barButtonItem);
            }