Cirrious.MvvmCross.Dialog.Touch.Dialog.Elements.HtmlElement.Selected C# (CSharp) Method

Selected() public method

public Selected ( DialogViewController dvc, UITableView tableView, NSIndexPath path ) : void
dvc DialogViewController
tableView UITableView
path NSIndexPath
return void
        public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
        {
            var vc = new WebViewController (this) {
                                                      Autorotate = dvc.Autorotate
                                                  };

            _web = new UIWebView (UIScreen.MainScreen.Bounds) {
                                                                 BackgroundColor = UIColor.White,
                                                                 ScalesPageToFit = true,
                                                                 AutoresizingMask = UIViewAutoresizing.All
                                                             };
            _web.LoadStarted += delegate {
                                            NetworkActivity = true;
                                            var indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White);
                                            vc.NavigationItem.RightBarButtonItem = new UIBarButtonItem(indicator);
                                            indicator.StartAnimating();
            };
            _web.LoadFinished += delegate {
                                             NetworkActivity = false;
                                             vc.NavigationItem.RightBarButtonItem = null;
            };
            _web.LoadError += (webview, args) => {
                                                    NetworkActivity = false;
                                                    vc.NavigationItem.RightBarButtonItem = null;
                                                    if (_web != null)
                                                        _web.LoadHtmlString (
                                                            String.Format ("<html><center><font size=+5 color='red'>{0}:<br>{1}</font></center></html>",
                                                                           "An error occurred:".GetText (), args.Error.LocalizedDescription), null);
            };
            vc.NavigationItem.Title = Caption;
			
            vc.View.AutosizesSubviews = true;
            vc.View.AddSubview (_web);
			
            dvc.ActivateController (vc);
            _web.LoadRequest (NSUrlRequest.FromUrl (_nsUrl));
        }
    }