From 08ff909b0ecbf2bb4f2567beb7e25084e78a74f9 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Fri, 5 Sep 2025 20:02:26 +0200 Subject: [PATCH] Update GeoImage.cs --- MapControl/Shared/GeoImage.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/MapControl/Shared/GeoImage.cs b/MapControl/Shared/GeoImage.cs index aee6e78e..c6ce19e8 100644 --- a/MapControl/Shared/GeoImage.cs +++ b/MapControl/Shared/GeoImage.cs @@ -67,7 +67,7 @@ namespace MapControl public static readonly DependencyProperty SourcePathProperty = DependencyPropertyHelper.RegisterAttached("SourcePath", typeof(GeoImage), null, - async (element, oldValue, newValue) => await LoadGeoImageAsync(element, newValue)); + async (element, oldValue, newValue) => await LoadGeoImage(element, newValue)); public static string GetSourcePath(FrameworkElement image) { @@ -83,12 +83,22 @@ namespace MapControl { var image = new Image(); - await LoadGeoImageAsync(image, sourcePath); + await LoadGeoImage(image, sourcePath); return image; } - public static async Task LoadGeoImageAsync(this FrameworkElement element, string sourcePath) + public static Task LoadGeoImageAsync(this Image image, string sourcePath) + { + return LoadGeoImage(image, sourcePath); + } + + public static Task LoadGeoImageAsync(this Shape shape, string sourcePath) + { + return LoadGeoImage(shape, sourcePath); + } + + private static async Task LoadGeoImage(FrameworkElement element, string sourcePath) { if (!string.IsNullOrEmpty(sourcePath)) {