From 1583b10ff31342f7e02836eb89a030b149f2e969 Mon Sep 17 00:00:00 2001 From: ClemensF Date: Thu, 20 Nov 2014 17:13:11 +0100 Subject: [PATCH] Version 2.4.1: Fixed TileLayer property update in MapBase. --- .../FileDbCache.WPF/Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- MapControl/MapBase.cs | 18 ++++++++++++------ MapControl/Properties/AssemblyInfo.cs | 4 ++-- MapControl/TileLayerCollection.cs | 9 +++++++++ MapControl/WinRT/Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../WpfApplication/Properties/AssemblyInfo.cs | 4 ++-- 13 files changed, 43 insertions(+), 28 deletions(-) diff --git a/Caching/FileDbCache.WPF/Properties/AssemblyInfo.cs b/Caching/FileDbCache.WPF/Properties/AssemblyInfo.cs index 4855c53b..e701f87f 100644 --- a/Caching/FileDbCache.WPF/Properties/AssemblyInfo.cs +++ b/Caching/FileDbCache.WPF/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Caching/FileDbCache.WinRT/Properties/AssemblyInfo.cs b/Caching/FileDbCache.WinRT/Properties/AssemblyInfo.cs index 02eedcb5..02ce4e59 100644 --- a/Caching/FileDbCache.WinRT/Properties/AssemblyInfo.cs +++ b/Caching/FileDbCache.WinRT/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Caching/ImageFileCache.WPF/Properties/AssemblyInfo.cs b/Caching/ImageFileCache.WPF/Properties/AssemblyInfo.cs index 5d71f9eb..590e88c8 100644 --- a/Caching/ImageFileCache.WPF/Properties/AssemblyInfo.cs +++ b/Caching/ImageFileCache.WPF/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Caching/ImageFileCache.WinRT/Properties/AssemblyInfo.cs b/Caching/ImageFileCache.WinRT/Properties/AssemblyInfo.cs index 62f128f7..cf492161 100644 --- a/Caching/ImageFileCache.WinRT/Properties/AssemblyInfo.cs +++ b/Caching/ImageFileCache.WinRT/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/MapControl/MapBase.cs b/MapControl/MapBase.cs index 02ad37e3..afc8b342 100644 --- a/MapControl/MapBase.cs +++ b/MapControl/MapBase.cs @@ -416,10 +416,9 @@ namespace MapControl { if (TileLayers == null) { - TileLayers = new TileLayerCollection(); + TileLayers = new TileLayerCollection(tileLayer); } - - if (TileLayers.Count == 0) + else if (TileLayers.Count == 0) { TileLayers.Add(tileLayer); } @@ -435,16 +434,18 @@ namespace MapControl if (oldTileLayers != null) { oldTileLayers.CollectionChanged -= TileLayerCollectionChanged; + + TileLayer = null; RemoveTileLayers(0, oldTileLayers.Count); } if (newTileLayers != null) { + TileLayer = newTileLayers.FirstOrDefault(); AddTileLayers(0, newTileLayers); + newTileLayers.CollectionChanged += TileLayerCollectionChanged; } - - TileLayer = TileLayers.FirstOrDefault(); } private void TileLayerCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) @@ -481,7 +482,12 @@ namespace MapControl break; } - TileLayer = TileLayers.FirstOrDefault(); + var tileLayer = TileLayers.FirstOrDefault(); + + if (TileLayer != tileLayer) + { + TileLayer = tileLayer; + } } private void AddTileLayers(int index, IEnumerable tileLayers) diff --git a/MapControl/Properties/AssemblyInfo.cs b/MapControl/Properties/AssemblyInfo.cs index b1552621..4012d169 100644 --- a/MapControl/Properties/AssemblyInfo.cs +++ b/MapControl/Properties/AssemblyInfo.cs @@ -17,8 +17,8 @@ using System.Windows; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/MapControl/TileLayerCollection.cs b/MapControl/TileLayerCollection.cs index 635f3a1a..f638dd2e 100644 --- a/MapControl/TileLayerCollection.cs +++ b/MapControl/TileLayerCollection.cs @@ -9,6 +9,15 @@ namespace MapControl { public class TileLayerCollection : ObservableCollection { + internal TileLayerCollection(TileLayer tileLayer) + { + Add(tileLayer); + } + + public TileLayerCollection() + { + } + public TileLayer this[string sourceName] { get { return this.FirstOrDefault(t => t.SourceName == sourceName); } diff --git a/MapControl/WinRT/Properties/AssemblyInfo.cs b/MapControl/WinRT/Properties/AssemblyInfo.cs index 18859ae1..522f590e 100644 --- a/MapControl/WinRT/Properties/AssemblyInfo.cs +++ b/MapControl/WinRT/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs b/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs index 5d4d56ce..912f9044 100644 --- a/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/PhoneApplication/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs index 8681116d..353eee48 100644 --- a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs +++ b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs index 78867edc..bddcb0a5 100644 --- a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs index ae28ef43..e9f23182 100644 --- a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs index e2b8582a..2e17b6d8 100644 --- a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("2.4.0")] -[assembly: AssemblyFileVersion("2.4.0")] +[assembly: AssemblyVersion("2.4.1")] +[assembly: AssemblyFileVersion("2.4.1")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)]