From 1f8164e82dee0ec1c50224f3ea88b2928a995d72 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Sun, 26 Jan 2025 21:12:34 +0100 Subject: [PATCH] Update MapOverlaysPanel.cs --- MapControl/Shared/MapOverlaysPanel.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MapControl/Shared/MapOverlaysPanel.cs b/MapControl/Shared/MapOverlaysPanel.cs index 034ad844..c953605a 100644 --- a/MapControl/Shared/MapOverlaysPanel.cs +++ b/MapControl/Shared/MapOverlaysPanel.cs @@ -26,7 +26,7 @@ namespace MapControl { public static readonly DependencyProperty SourcePathsProperty = DependencyPropertyHelper.Register>(nameof(SourcePaths), null, - async (control, oldValue, newValue) => await control.SourcePathsPropertyChangedAsync(oldValue, newValue)); + async (control, oldValue, newValue) => await control.SourcePathsPropertyChanged(oldValue, newValue)); public IEnumerable SourcePaths { @@ -34,7 +34,7 @@ namespace MapControl set => SetValue(SourcePathsProperty, value); } - private async Task SourcePathsPropertyChangedAsync(IEnumerable oldSourcePaths, IEnumerable newSourcePaths) + private async Task SourcePathsPropertyChanged(IEnumerable oldSourcePaths, IEnumerable newSourcePaths) { Children.Clear(); @@ -50,7 +50,7 @@ namespace MapControl newCollection.CollectionChanged += SourcePathsCollectionChanged; } - await AddOverlaysAsync(0, newSourcePaths); + await AddOverlays(0, newSourcePaths); } } @@ -59,7 +59,7 @@ namespace MapControl switch (args.Action) { case NotifyCollectionChangedAction.Add: - await AddOverlaysAsync(args.NewStartingIndex, args.NewItems.Cast()); + await AddOverlays(args.NewStartingIndex, args.NewItems.Cast()); break; case NotifyCollectionChangedAction.Remove: @@ -68,21 +68,21 @@ namespace MapControl case NotifyCollectionChangedAction.Move: RemoveOverlays(args.OldStartingIndex, args.OldItems.Count); - await AddOverlaysAsync(args.NewStartingIndex, args.NewItems.Cast()); + await AddOverlays(args.NewStartingIndex, args.NewItems.Cast()); break; case NotifyCollectionChangedAction.Replace: - await ReplaceOverlaysAsync(args.NewStartingIndex, args.NewItems.Cast()); + await ReplaceOverlays(args.NewStartingIndex, args.NewItems.Cast()); break; case NotifyCollectionChangedAction.Reset: Children.Clear(); - await AddOverlaysAsync(0, SourcePaths); + await AddOverlays(0, SourcePaths); break; } } - private async Task AddOverlaysAsync(int index, IEnumerable sourcePaths) + private async Task AddOverlays(int index, IEnumerable sourcePaths) { foreach (var sourcePath in sourcePaths) { @@ -90,7 +90,7 @@ namespace MapControl } } - private async Task ReplaceOverlaysAsync(int index, IEnumerable sourcePaths) + private async Task ReplaceOverlays(int index, IEnumerable sourcePaths) { foreach (var sourcePath in sourcePaths) {