ActivateController() public méthode

Activates a nested view controller from the DialogViewController. If the view controller is hosted in a UINavigationController it will push the result. Otherwise it will show it as a modal dialog
public ActivateController ( UIViewController controller, DialogViewController oldController ) : void
controller UIViewController
oldController DialogViewController
Résultat void
        public void Selected(DialogViewController controller, UITableView tableView, object item, NSIndexPath indexPath)
        {
            var frame = UIScreen.MainScreen.Bounds;

            Web = new UIWebView(frame)
            {
                BackgroundColor = UIColor.White, ScalesPageToFit = true, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
            };
            Web.LoadStarted  += (sender, e) => NetworkActivity = true;
            Web.LoadFinished += (sender, e) => NetworkActivity = false;
            Web.LoadError    += (webview, args) =>
            {
                NetworkActivity = false;
                if (Web != null)
                {
                    Web.LoadHtmlString(String.Format("<html><center><font size=+5 color='red'>An error occurred:<br>{0}</font></center></html>", args.Error.LocalizedDescription), null);
                }
            };

            _WebViewController = new WebViewController(this)
            {
                Autorotate = controller.Autorotate, Title = Caption
            };
            _WebViewController.View.AddSubview(Web);

            controller.ActivateController(_WebViewController, controller);

            var url = new NSUrl(Value.AbsoluteUri);

            Web.LoadRequest(NSUrlRequest.FromUrl(url));
        }
        public void Selected(DialogViewController controller, UITableView tableView, object item, NSIndexPath path)
        {
            var list = DataContext.Value as IEnumerable <CLLocationCoordinate2D>;

            if (list == null)
            {
                list = new List <CLLocationCoordinate2D>()
                {
                    (CLLocationCoordinate2D)DataContext.Value
                };
            }
            var mapViewController = new MapViewController(list)
            {
                Title = Caption
            };

            controller.ActivateController(mapViewController, controller);
        }
		public void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
		{
			var mapViewController = new MapViewController((CLLocationCoordinate2D)DataContext) { Title = Caption };
			dvc.ActivateController(mapViewController, dvc);
		}
		public void ActivateController(DialogViewController dvc, UITableView tableView, NSIndexPath path)
		{	
			var newDvc = MakeViewController(dvc.Style);
			PrepareDialogViewController(newDvc);
			dvc.ActivateController(newDvc, dvc);
			
			tableView.DeselectRow(path, false);
		}
		public void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
		{
			if (picker == null)
				picker = new UIImagePickerController();
			picker.Delegate = new MyDelegate(this, tableView, path);

			switch (UIDevice.CurrentDevice.UserInterfaceIdiom)
			{
				case UIUserInterfaceIdiom.Pad:
					RectangleF useRect;
					popover = new UIPopoverController(picker);
					var cell = tableView.CellAt(path);
					if (cell == null)
						useRect = rect;
					else
						useRect = cell.Frame;
					popover.PresentFromRect(useRect, dvc.View, UIPopoverArrowDirection.Any, true);
					break;
				default:
				
				case UIUserInterfaceIdiom.Phone:
					dvc.ActivateController(picker, dvc);
					break;
			}
			currentController = dvc;
		}
		public void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
		{
			var vc = new WebViewController(this) { Autorotate = dvc.Autorotate };
			var frame = UIScreen.MainScreen.Bounds;

			web = new UIWebView(frame) { BackgroundColor = UIColor.White, ScalesPageToFit = true, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight };
			web.LoadStarted += delegate { NetworkActivity = true; };
			web.LoadFinished += delegate { NetworkActivity = false; };
			web.LoadError += (webview, args) =>
			{
				NetworkActivity = false;
				if (web != null)
					web.LoadHtmlString(String.Format("<html><center><font size=+5 color='red'>An error occurred:<br>{0}</font></center></html>", args.Error.LocalizedDescription), null);
			};
			vc.NavigationItem.Title = Caption;
			vc.View.AddSubview(web);
			
			dvc.ActivateController(vc, dvc);

			var url = new NSUrl(Uri.AbsoluteUri);
			web.LoadRequest(NSUrlRequest.FromUrl(url));
		}