private void TellMeMore() { const string url = "https://help.github.com/articles/about-third-party-application-restrictions/"; var view = new WebBrowserViewController(url); PresentViewController(view, true, null); }
private void ShareButtonPress(UIBarButtonItem barButtonItem) { var sheet = new UIActionSheet(); var shareButton = sheet.AddButton("Share"); var showButton = sheet.AddButton("Show in GitHub"); var cancelButton = sheet.AddButton("Cancel"); sheet.CancelButtonIndex = cancelButton; sheet.Dismissed += (sender, e) => { BeginInvokeOnMainThread(() => { if (e.ButtonIndex == showButton) { var viewController = new WebBrowserViewController(Readme.HtmlUrl); PresentViewController(viewController, true, null); } else if (e.ButtonIndex == shareButton) { AlertDialogService.Share( $"{_owner}/{_repository} Readme", url: Readme.HtmlUrl, barButtonItem: barButtonItem); } }); sheet.Dispose(); }; sheet.ShowFrom(barButtonItem, true); }
private void TellMeMore() { const string url = "https://help.github.com/articles/about-third-party-application-restrictions/"; var view = new WebBrowserViewController(url); view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Images.Buttons.CancelButton, UIBarButtonItemStyle.Done, (s, e) => DismissViewController(true, null)); PresentViewController(new ThemedNavigationController(view), true, null); }
private void ShowWebPage(string url) { var view = new WebBrowserViewController(url); view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Images.Buttons.CancelButton, UIBarButtonItemStyle.Done, (s, e) => DismissViewController(true, null)); PresentViewController(new ThemedNavigationController(view), true, null); }
protected override bool ShouldStartLoad(WebKit.WKWebView webView, WebKit.WKNavigationAction navigationAction) { if (!navigationAction.Request.Url.AbsoluteString.StartsWith("file://", StringComparison.Ordinal)) { var viewController = new WebBrowserViewController(navigationAction.Request.Url.AbsoluteString); PresentViewController(viewController, true, null); return(false); } return(base.ShouldStartLoad(webView, navigationAction)); }
private void ShowInBrowser() { var url = Content?.HtmlUrl; if (url == null) { return; } var viewController = new WebBrowserViewController(url); PresentViewController(viewController, true, null); }
public override bool ShouldStartLoad(WKWebView webView, WKNavigationAction navigationAction) { var url = navigationAction.Request.Url.AbsoluteString; if (!url.StartsWith("file://", StringComparison.Ordinal)) { var webBrowser = new WebBrowserViewController(url); PresentViewController(webBrowser, true, null); return(false); } return(base.ShouldStartLoad(webView, navigationAction)); }
protected virtual bool ShouldStartLoad(NSUrlRequest request, UIWebViewNavigationType navigationType) { var url = request.Url; if (url.Scheme.Equals("app")) { var func = url.Host; if (string.Equals(func, "buy", StringComparison.OrdinalIgnoreCase)) { // Purchase Activate(_featuresService.ActivatePro).ToBackground(); } else if (string.Equals(func, "restore", StringComparison.OrdinalIgnoreCase)) { // Restore Activate(_featuresService.RestorePro).ToBackground(); } return(false); } if (url.Scheme.Equals("mailto", StringComparison.OrdinalIgnoreCase)) { UIApplication.SharedApplication.OpenUrl(url); return(false); } if (url.Scheme.Equals("file")) { return(true); } if (url.Scheme.Equals("http") || url.Scheme.Equals("https")) { var vm = new WebBrowserViewModel().Init(url.AbsoluteString); var view = new WebBrowserViewController(true, true) { ViewModel = vm }; view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Images.Cancel, UIBarButtonItemStyle.Done, (s, e) => DismissViewController(true, null)); PresentViewController(new ThemedNavigationController(view), true, null); return(false); } return(false); }
protected override bool ShouldStartLoad(WebKit.WKWebView webView, WebKit.WKNavigationAction navigationAction) { var url = navigationAction.Request.Url; if (url.Scheme.Equals("app")) { var func = url.Host; if (string.Equals(func, "buy", StringComparison.OrdinalIgnoreCase)) { Activate(_featuresService.ActivatePro).ToBackground(); } else if (string.Equals(func, "restore", StringComparison.OrdinalIgnoreCase)) { Activate(_featuresService.RestorePro).ToBackground(); } return(false); } if (url.Scheme.Equals("mailto", StringComparison.OrdinalIgnoreCase)) { UIApplication.SharedApplication.OpenUrl(url); return(false); } if (url.Scheme.Equals("file")) { return(true); } if (url.Scheme.Equals("http") || url.Scheme.Equals("https")) { var view = new WebBrowserViewController(url.AbsoluteString); view.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Images.Buttons.CancelButton, UIBarButtonItemStyle.Done, (s, e) => DismissViewController(true, null)); PresentViewController(new ThemedNavigationController(view), true, null); return(false); } return(false); }
protected override bool ShouldStartLoad(WebKit.WKWebView webView, WebKit.WKNavigationAction navigationAction) { var url = navigationAction.Request.Url; if (url.Scheme.Equals("app")) { var func = url.Host; if (string.Equals(func, "buy", StringComparison.OrdinalIgnoreCase)) { Activate(_featuresService.ActivatePro).ToBackground(); } else if (string.Equals(func, "restore", StringComparison.OrdinalIgnoreCase)) { Activate(_featuresService.RestorePro).ToBackground(); } return(false); } if (url.Scheme.Equals("mailto", StringComparison.OrdinalIgnoreCase)) { UIApplication.SharedApplication.OpenUrl(url); return(false); } if (url.Scheme.Equals("file")) { return(true); } if (url.Scheme.Equals("http") || url.Scheme.Equals("https")) { var view = new WebBrowserViewController(url.AbsoluteString); PresentViewController(view, true, null); return(false); } return(false); }
private void GoToGitHub() { var viewController = new WebBrowserViewController(CodeHubUrl); PresentViewController(viewController, true, null); }
private void ShowWebPage(string url) { var view = new WebBrowserViewController(url); PresentViewController(view, true, null); }