public static void UpdateProperties(this Xamarin.Forms.WebView fView, WebView view) { fView.UpdateBaseProperties(view); if (string.IsNullOrWhiteSpace(view.Html)) { fView.Source = new Xamarin.Forms.HtmlWebViewSource { Html = view.Html } } ; fView.Source = view.Source.ToWebViewSource(); }
public static bool UpdateProperty(this Xamarin.Forms.WebView fView, string property, object value) { switch (property) { case nameof(WebView.Html): fView.Source = value == null ? null : new Xamarin.Forms.HtmlWebViewSource { Html = (string)value }; return(true); case nameof(WebView.Source): fView.Source = (value as string).ToWebViewSource(); return(true); } return(fView.UpdateBaseProperty(property, value)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.add_url); Xamarin.Forms.Forms.Init(this, savedInstanceState); recipeUrl = FindViewById <TextView>(Resource.Id.urlToLookText); recipeUrl.TextChanged += RecipeUrlTextChanged; recipePreview = FindViewById <Xamarin.Forms.WebView>(Resource.Id.recepiePreview); //recipePreview.Settings.JavaScriptEnabled = true; //web_view.SetWebViewClient(new HelloWebViewClient()); recipePreview.Source = "https://chadeyka.livejournal.com/216950.html"; Button paresSelectionButton = FindViewById <Button>(Resource.Id.startParseRecepieButton); paresSelectionButton.Click += ParesSelectionButton_Click; //Button addWithUrlButton = FindViewById<Button>(Resource.Id.addWithUrlButton); //addWithUrlButton.Click += addWithUrlButton_Click; }
public CustomWebViewDelegate(WebView webView) { formsWebView = webView; }
public static async void DownloadDocument(ProjectData projectdata, string uid) { //var m_Http = XComosMobile.Services.XServices.Instance.GetService<HttpClient>(); ////var http = m_ComosWeb.GetComosHttpClient(); //string project = projectdata.SelectedProject.UID; //string workinglayer = projectdata.SelectedLayer.UID; //string language = projectdata.SelectedLanguage.LCID; //var db = Services.XServices.Instance.GetService<Services.XDatabase>(); //string servername = db.ReadSetting("ServerName", "http://siemens.southcentralus.cloudapp.azure.com"); //uid = "A3XXX6021Z"; //project = "iDB_P01"; //workinglayer = "52"; //string url = string.Format(servername + "/BRMobile/Download/{0}/{1}/{2}/{3}", // uid, WebUtility.UrlEncode(project), WebUtility.UrlEncode(workinglayer), "false"); //var response = await m_Http.GetAsync(url); //System.IO.Stream st = response.Content.ReadAsStreamAsync().Result; /* * * FileStream fileStream = File.Create(fileFullPath, (int)stream.Length); * // Initialize the bytes array with the stream length and then fill it with data * byte[] bytesInStream = new byte[stream.Length]; * stream.Read(bytesInStream, 0, bytesInStream.Length); * // Use write method to write to the file specified above * fileStream.Write(bytesInStream, 0, bytesInStream.Length); * */ /* * var platform = Services.XServices.Instance.GetService<Services.IPlatformSystem>(); * if (response.StatusCode != HttpStatusCode.OK) * { * return false; * } * * output = await response.Content.ReadAsStringAsync(); * * IBRServiceContracts.TResult<IBRServiceContracts.CWriteValueResult[]> result = * Newtonsoft.Json.JsonConvert.DeserializeObject< * IBRServiceContracts.TResult<IBRServiceContracts.CWriteValueResult[]>>(output); * if (!result.Status) * { * return false; * } */ //return true; Xamarin.Forms.WebView v = new Xamarin.Forms.WebView(); v.Source = "http://siemens.southcentralus.cloudapp.azure.com/api/webview/v1/dbs/db1/projects/U:2:A3BQHFA8AR:/documents/U:29:A3XXUPEM1Z:?overlayid=U:42:A3Y4157Q7Q:"; v.Navigated += V_Navigated; }