public ActivateController ( UIViewController controller ) : void | ||
controller | UIViewController | |
리턴 | void |
public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path) { var vc = new MyViewController(this) { Autorotate = dvc.Autorotate }; datePicker = CreatePicker(); datePicker.Frame = PickerFrameWithSize(datePicker.SizeThatFits(SizeF.Empty)); vc.View.BackgroundColor = UIColor.Black; vc.View.AddSubview(datePicker); dvc.ActivateController(vc); }
public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) { if (Url == null){ base.Selected (dvc, tableView, path); return; } tableView.DeselectRow (path, false); if (loading) return; var cell = GetActiveCell (); var spinner = StartSpinner (cell); loading = true; var wc = new WebClient (); wc.DownloadStringCompleted += delegate (object sender, DownloadStringCompletedEventArgs e){ dvc.BeginInvokeOnMainThread (delegate { loading = false; spinner.StopAnimating (); spinner.RemoveFromSuperview (); if (e.Result != null){ try { var obj = JsonValue.Load (new StringReader (e.Result)) as JsonObject; if (obj != null){ var root = JsonElement.FromJson (obj); var newDvc = new DialogViewController (root, true) { Autorotate = true }; PrepareDialogViewController (newDvc); dvc.ActivateController (newDvc); return; } } catch (Exception ee){ Console.WriteLine (ee); } } var alert = new UIAlertView ("Error", "Unable to download data", null, "Ok"); alert.Show (); }); }; wc.DownloadStringAsync (new Uri (Url)); }
public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path) { var vc = new MyViewController(this) { Autorotate = dvc.Autorotate }; datePicker = CreatePicker(); datePicker.Frame = PickerFrameWithSize(datePicker.SizeThatFits(SizeF.Empty)); vc.View.BackgroundColor = UIColor.Black; vc.View.AddSubview(datePicker); dvc.ActivateController(vc); }
void msgSelected (DialogViewController dvc, UITableView tv, NSIndexPath path) { var np = new DialogViewController (new RootElement ("Message Display") { new Section () { new StyledMultilineElement ( "From: foo\n" + "To: bar\n" + "Subject: Hey there\n\n" + "This is very simple!") } }, true); dvc.ActivateController (np); }