private async void webView_DOMContentLoaded(WebView sender, WebViewDOMContentLoadedEventArgs args) { await AzureIoTHub.RegisterDirectMethodAsync( "SearchFuzzy", async delegate(string query) { System.Diagnostics.Debug.WriteLine($"Request for 'SearchFuzzy' is received."); await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => await webView.InvokeScriptAsync("eval", new[] { $"document.getElementById('search-input').value = '{query}'; shouldChangeCamera = true; search(searchResultsHandler);" }) ); }); await AzureIoTHub.RegisterDirectMethodAsync( "ZoomIn", async delegate(string query) { System.Diagnostics.Debug.WriteLine($"Request for 'ZoomIn' is received."); await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => await webView.InvokeScriptAsync("eval", new[] { $"plusZoomElement.click();" }) ); }); await AzureIoTHub.RegisterDirectMethodAsync( "ZoomOut", async delegate(string query) { System.Diagnostics.Debug.WriteLine($"Request for 'ZoomOut' is received."); await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() => await webView.InvokeScriptAsync("eval", new[] { $"minusZoomElement.click();" }) ); }); }