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(); }
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(); }
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 }
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 }
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); }; }
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; }; }
public override void WillShowViewController(UISplitViewController svc, UIViewController aViewController, UIBarButtonItem button) { DetailViewController detailView = svc.ViewControllers[1] as DetailViewController; detailView.RemoveContentsButton(); }
public override void WillHideViewController(UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc) { DetailViewController detailView = svc.ViewControllers[1] as DetailViewController; detailView.AddContentsButton(barButtonItem); }