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 GeoJsonContentEditorContext(StatusControlContext statusContext) { StatusContext = statusContext ?? new StatusControlContext(); HelpContext = new HelpDisplayContext(CommonFields.TitleSlugFolderSummary + BracketCodeHelpMarkdown.HelpBlock); SaveCommand = StatusContext.RunBlockingTaskCommand(async () => await SaveAndGenerateHtml(false)); SaveAndCloseCommand = StatusContext.RunBlockingTaskCommand(async () => await SaveAndGenerateHtml(true)); ViewOnSiteCommand = StatusContext.RunBlockingTaskCommand(ViewOnSite); ExtractNewLinksCommand = StatusContext.RunBlockingTaskCommand(() => LinkExtraction.ExtractNewAndShowLinkContentEditors( $"{BodyContent.BodyContent} {UpdateNotes.UpdateNotes}", StatusContext.ProgressTracker())); ImportGeoJsonFileCommand = StatusContext.RunBlockingTaskCommand(ImportGeoJsonFile); RefreshMapPreviewCommand = StatusContext.RunBlockingTaskCommand(RefreshMapPreview); PreviewHtml = WpfHtmlDocument.ToHtmlLeafletGeoJsonDocument("GeoJson", UserSettingsSingleton.CurrentSettings().LatitudeDefault, UserSettingsSingleton.CurrentSettings().LongitudeDefault, string.Empty); }