private void OnUserNavigationRequested(FormsWebView sender, string uri, Abstractions.Enumerations.WebViewContentType contentType)
        {
            if (Element == sender)
            {
                switch (contentType)
                {
                case Abstractions.Enumerations.WebViewContentType.Internet:
                    Control.LoadRequest(new NSUrlRequest(new NSUrl(uri)));
                    break;

                case Abstractions.Enumerations.WebViewContentType.LocalFile:
                    LoadLocalContent(uri);
                    break;

                case Abstractions.Enumerations.WebViewContentType.StringData:
                    Control.LoadHtmlString(new NSString(uri), BaseUrl == null ? null : new NSUrl(BaseUrl));
                    break;
                }
            }
        }
Exemple #2
0
        void OnUserNavigationRequested(FormsWebView sender, string uri, Abstractions.Enumerations.WebViewContentType contentType)
        {
            if (Element == sender)
            {
                switch (contentType)
                {
                case Abstractions.Enumerations.WebViewContentType.Internet:
                    Control.LoadRequest(new NSUrlRequest(new NSUrl(uri)));
                    break;

                case Abstractions.Enumerations.WebViewContentType.LocalFile:
                    LoadLocalContent(uri);
                    break;

                case Abstractions.Enumerations.WebViewContentType.StringData:
                    Control.LoadHtmlString(uri, new NSUrl(string.Concat("file://", GetCorrectBaseUrl(), "/")));
                    break;
                }
            }
        }
        private void OnUserNavigationRequested(FormsWebView sender, string uri, Abstractions.Enumerations.WebViewContentType contentType, string baseUri)
        {
            if (Element == sender)
            {
                switch (contentType)
                {
                case Abstractions.Enumerations.WebViewContentType.Internet:
                    Control.LoadRequest(new NSUrlRequest(new NSUrl(uri)));
                    break;

                case Abstractions.Enumerations.WebViewContentType.LocalFile:
                    Control.LoadFileUrl(new NSUrl("file://" + Path.Combine(UriBase, uri)), new NSUrl("file://" + UriBase));
                    break;

                case Abstractions.Enumerations.WebViewContentType.StringData:
                    Control.LoadHtmlString(new NSString(uri), baseUri == null ? null : new NSUrl(baseUri));
                    break;
                }
            }
        }