private async void CommunicationWinRT_OnNotifyApp(string str) { await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => { await HtmlWebView.InvokeScriptAsync("eval", new string[] { "doSomething()" }); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); this.Title = pediometricDiseaseName; this.View.BackgroundColor = UIColor.White; string fileName = "prematurity.html"; // remember case-sensitive string localHtmlUrl = Path.Combine(NSBundle.MainBundle.BundlePath, fileName); HtmlWebView.LoadRequest(new NSUrlRequest(new NSUrl(localHtmlUrl, false))); HtmlWebView.ScalesPageToFit = false; // Perform any additional setup after loading the view, typically from a nib. }
private async void btntest_Click(object sender, RoutedEventArgs e) { await HtmlWebView.InvokeScriptAsync("eval", new string[] { "doSomething()" }); }