From d7eb8246274745bd3325367c27a7e1768b1c1f66 Mon Sep 17 00:00:00 2001 From: Morten Nielsen Date: Fri, 30 Aug 2024 13:35:59 -0700 Subject: [PATCH] Improve the loading speed of the basemap gallery (#599) Co-authored-by: Morten Nielsen --- .../BasemapGallery/BasemapGalleryController.cs | 12 +----------- .../UI/Controls/BasemapGallery/BasemapGalleryItem.cs | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryController.cs b/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryController.cs index 1a2cdd1e7..f0cd143af 100644 --- a/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryController.cs +++ b/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryController.cs @@ -324,20 +324,10 @@ private static async Task> PopulateFromDefaultList(Can listOfBasemaps.Add(new BasemapGalleryItem(basemap)); } -#if !WINDOWS_XAML && !NETCOREAPP - await Task.WhenAll(listOfBasemaps.Select(gi => gi.LoadAsync())); -#else foreach (var item in listOfBasemaps) { - try - { - await item.LoadAsync(); - } - catch (Exception) - { - } + _ = item.LoadAsync(); } -#endif return new ObservableCollection(listOfBasemaps); } diff --git a/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs b/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs index d15258827..ac4b6a62c 100644 --- a/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs +++ b/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs @@ -392,7 +392,7 @@ public string Name { get { - return _nameOverride ?? Basemap.Name; + return _nameOverride ?? (string.IsNullOrEmpty(Basemap.Name) ? Basemap.Item?.Name ?? string.Empty : Basemap.Name); } set