From b1bfccd321ac9a4f356ef6fe9ace93a9774dda00 Mon Sep 17 00:00:00 2001 From: ClemensF Date: Fri, 1 Mar 2013 16:27:22 +0100 Subject: [PATCH] Version 1.1.8: Fixed MapPolyline.MeasureOverride also for WPF. --- Caching/FileDbCache/Properties/AssemblyInfo.cs | 4 ++-- Caching/ImageFileCache/Properties/AssemblyInfo.cs | 4 ++-- MapControl/MapPolyline.Silverlight.WinRT.cs | 9 --------- MapControl/MapPolyline.WPF.cs | 2 -- MapControl/MapPolyline.cs | 11 +++++++++++ MapControl/Properties/AssemblyInfo.cs | 4 ++-- MapControl/WinRT/Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../SilverlightApplication/Properties/AssemblyInfo.cs | 4 ++-- .../StoreApplication/Properties/AssemblyInfo.cs | 4 ++-- .../SurfaceApplication/Properties/AssemblyInfo.cs | 4 ++-- SampleApps/WpfApplication/Properties/AssemblyInfo.cs | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Caching/FileDbCache/Properties/AssemblyInfo.cs b/Caching/FileDbCache/Properties/AssemblyInfo.cs index 9f2d266b..63e89846 100644 --- a/Caching/FileDbCache/Properties/AssemblyInfo.cs +++ b/Caching/FileDbCache/Properties/AssemblyInfo.cs @@ -9,6 +9,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] diff --git a/Caching/ImageFileCache/Properties/AssemblyInfo.cs b/Caching/ImageFileCache/Properties/AssemblyInfo.cs index 8b5dbaf3..966d6dba 100644 --- a/Caching/ImageFileCache/Properties/AssemblyInfo.cs +++ b/Caching/ImageFileCache/Properties/AssemblyInfo.cs @@ -9,6 +9,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] diff --git a/MapControl/MapPolyline.Silverlight.WinRT.cs b/MapControl/MapPolyline.Silverlight.WinRT.cs index b822b985..704bf6d2 100644 --- a/MapControl/MapPolyline.Silverlight.WinRT.cs +++ b/MapControl/MapPolyline.Silverlight.WinRT.cs @@ -4,7 +4,6 @@ using System.Linq; #if NETFX_CORE -using Windows.Foundation; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Shapes; #else @@ -25,14 +24,6 @@ namespace MapControl MapPanel.AddParentMapHandlers(this); } - protected override Size MeasureOverride(Size constraint) - { - // The Silverlight Path.MeasureOverride occasionally tries to create a Size from - // a negative width or height, apparently resulting from a transformed geometry - // in Path.Data. It seems to be sufficient to always return a non-zero size. - return new Size(1, 1); - } - private void UpdateGeometry() { var parentMap = MapPanel.GetParentMap(this); diff --git a/MapControl/MapPolyline.WPF.cs b/MapControl/MapPolyline.WPF.cs index 013d9ec0..81c92246 100644 --- a/MapControl/MapPolyline.WPF.cs +++ b/MapControl/MapPolyline.WPF.cs @@ -2,9 +2,7 @@ // Copyright © 2013 Clemens Fischer // Licensed under the Microsoft Public License (Ms-PL) -using System.Collections.Generic; using System.Linq; -using System.Windows; using System.Windows.Media; using System.Windows.Shapes; diff --git a/MapControl/MapPolyline.cs b/MapControl/MapPolyline.cs index 5ad4fd24..d0e51a8b 100644 --- a/MapControl/MapPolyline.cs +++ b/MapControl/MapPolyline.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; #if NETFX_CORE +using Windows.Foundation; using Windows.UI.Xaml; #else using System.Windows; @@ -48,6 +49,16 @@ namespace MapControl set { SetValue(IsClosedProperty, value); } } + protected override Size MeasureOverride(Size constraint) + { + // Shape.MeasureOverride in WPF and WinRT sometimes return a Size with zero + // width or height, whereas Shape.MeasureOverride in Silverlight occasionally + // throws an ArgumentException, as it tries to create a Size from a negative + // width or height, apparently resulting from a transformed geometry in Path.Data. + // In either case it seems to be sufficient to simply return a non-zero size. + return new Size(1, 1); + } + void IMapElement.ParentMapChanged(MapBase oldParentMap, MapBase newParentMap) { UpdateGeometry(); diff --git a/MapControl/Properties/AssemblyInfo.cs b/MapControl/Properties/AssemblyInfo.cs index 56d9581e..938ecf7a 100644 --- a/MapControl/Properties/AssemblyInfo.cs +++ b/MapControl/Properties/AssemblyInfo.cs @@ -16,6 +16,6 @@ using System.Windows; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] diff --git a/MapControl/WinRT/Properties/AssemblyInfo.cs b/MapControl/WinRT/Properties/AssemblyInfo.cs index 39b3ca6d..c6cfeba5 100644 --- a/MapControl/WinRT/Properties/AssemblyInfo.cs +++ b/MapControl/WinRT/Properties/AssemblyInfo.cs @@ -9,6 +9,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs index caef5402..f5a6afed 100644 --- a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs +++ b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs @@ -9,6 +9,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs index ca8e40a9..294a80d0 100644 --- a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs @@ -9,6 +9,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] diff --git a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs index b72f499d..1e792d5b 100644 --- a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs @@ -9,6 +9,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] diff --git a/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs b/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs index bef1ff3d..f758ca60 100644 --- a/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Windows; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] diff --git a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs index 09654db6..11f85011 100644 --- a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Windows; [assembly: AssemblyCopyright("Copyright © 2013 Clemens Fischer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("1.1.7")] -[assembly: AssemblyFileVersion("1.1.7")] +[assembly: AssemblyVersion("1.1.8")] +[assembly: AssemblyFileVersion("1.1.8")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]