diff --git a/src/Toolkit/Toolkit/UI/Controls/PopupViewer/FieldsPopupElementView.cs b/src/Toolkit/Toolkit/UI/Controls/PopupViewer/FieldsPopupElementView.cs index 08a9a10ff..b9a0af058 100644 --- a/src/Toolkit/Toolkit/UI/Controls/PopupViewer/FieldsPopupElementView.cs +++ b/src/Toolkit/Toolkit/UI/Controls/PopupViewer/FieldsPopupElementView.cs @@ -18,6 +18,12 @@ using Esri.ArcGISRuntime.Data; using Esri.ArcGISRuntime.Mapping.Popups; using Esri.ArcGISRuntime.Toolkit.Internal; +#if MAUI +using Esri.ArcGISRuntime.Toolkit.Maui; +#else +using Esri.ArcGISRuntime.Toolkit.UI.Controls; +#endif + #if MAUI using TextBlock = Microsoft.Maui.Controls.Label; #else @@ -134,7 +140,7 @@ private void RefreshTable() gestureRecognizer.Tapped += (s, e) => { if (uri is not null) - _ = Launcher.LaunchUriAsync(uri); + PopupViewer.GetPopupViewerParent(this)?.OnHyperlinkClicked(uri); }; t.GestureRecognizers.Add(gestureRecognizer); t.FormattedText = new FormattedString(); @@ -144,7 +150,7 @@ private void RefreshTable() hl.Click += (s, e) => { if (uri is not null) - _ = Launcher.LaunchUriAsync(uri); + PopupViewer.GetPopupViewerParent(this)?.OnHyperlinkClicked(uri); }; hl.Inlines.Add("View"); t.Inlines.Add(hl); @@ -234,4 +240,4 @@ public Style FieldTextStyle PropertyHelper.CreateProperty(nameof(FieldTextStyle)); } } -#endif \ No newline at end of file +#endif