private void PointContextOnRaisePointLatitudeLongitudeChange(object sender, PointLatitudeLongitudeChange e) { _webViewWorkQueue.Enqueue(async() => { await ThreadSwitcher.ResumeForegroundAsync(); await PointContentWebView.ExecuteScriptAsync( $@"pointContentMarker.setLatLng([{e.Latitude},{e.Longitude}]); map.setView([{e.Latitude},{e.Longitude}], map.getZoom());"); }); }
private void PointContentEditorControl_OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { if (e.NewValue is PointContentEditorContext pointContext) { _webViewWorkQueue.Enqueue(async() => { await ThreadSwitcher.ResumeForegroundAsync(); PointContentWebView.NavigateToString(WpfHtmlDocument.ToHtmlLeafletPointDocument("Point Map", pointContext.LatitudeEntry.UserValue, pointContext.LongitudeEntry.UserValue, string.Empty)); }); RaisePointLatitudeLongitudeChange += pointContext.OnRaisePointLatitudeLongitudeChange; pointContext.RaisePointLatitudeLongitudeChange += PointContextOnRaisePointLatitudeLongitudeChange; } }
private async void PointContentEditorControl_OnLoaded(object sender, RoutedEventArgs e) { await PointContentWebView.EnsureCoreWebView2Async(); }