コード例 #1
0
        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());");
            });
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 private async void PointContentEditorControl_OnLoaded(object sender, RoutedEventArgs e)
 {
     await PointContentWebView.EnsureCoreWebView2Async();
 }