MonoTouch.Dialog.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.ApplicationFrame){
                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);
            web.LoadRequest (NSUrlRequest.FromUrl (nsUrl));
        }