Beispiel #1
0
        public MainSplitView() : base()
        {
            //---- create our master and detail views
            this._masterView = new Screens.iPad.NavTable.MasterNavTableViewController();
            this._detailView = new Screens.iPad.BasicUIViewAnimation.BasicUIViewAnimationScreen();

            //---- create an array of controllers from them and then assign it to the
            // controllers property
            this.ViewControllers = new UIViewController[] { this._masterView, this._detailView };

            //---- 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).
            this._masterView.RowClicked += (object sender, RowClickedEventArgs e) => {
                this.HandleRowClicked(e);
            };

            //---- when the master view controller is hid (portrait mode), we add a button to
            // the detail view that when clicked will show the master view in a popover controller
            this.WillHideViewController += (object sender, UISplitViewHideEventArgs e) => {
                (this._detailView as IDetailView).AddContentsButton(e.BarButtonItem);
            };

            //---- when the master view controller is shown (landscape mode), remove the button
            // since the controller is shown.
            this.WillShowViewController += (object sender, UISplitViewShowEventArgs e) => {
                (this._detailView as IDetailView).RemoveContentsButton();
            };
        }
		public MainSplitView () : base()
		{
			// create our master and detail views
			masterView = new Screens.iPad.NavTable.MasterNavTableViewController ();
			detailView = new Screens.iPad.BasicUIViewAnimation.BasicUIViewAnimationScreen ();

			// create an array of controllers from them and then assign it to the 
			// controllers property
			this.ViewControllers = new UIViewController[] {  masterView,  detailView };
			
			// 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, RowClickedEventArgs e) => {
				this.HandleRowClicked (e);
			};
			
			// when the master view controller is hid (portrait mode), we add a button to 
			// the detail view that when clicked will show the master view in a popover controller
			this.WillHideViewController += (object sender, UISplitViewHideEventArgs e) => {
				(detailView as IDetailView).AddContentsButton (e.BarButtonItem);
			};

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