From 8e85aa8e17beece91eab250aa577476a282a6bf0 Mon Sep 17 00:00:00 2001 From: ClemensF Date: Thu, 3 Jan 2013 17:07:59 +0100 Subject: [PATCH] Workaround for Locations property type in MapPolyline. --- MapControl/MapPolyline.Silverlight.cs | 5 +++++ MapControl/MapPolyline.WPF.cs | 5 +++++ MapControl/MapPolyline.WinRT.cs | 9 +++++++++ MapControl/MapPolyline.cs | 5 +---- MapControl/WinRT/MapControl.WinRT.csproj | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/MapControl/MapPolyline.Silverlight.cs b/MapControl/MapPolyline.Silverlight.cs index 1eb149e0..08b7e5ee 100644 --- a/MapControl/MapPolyline.Silverlight.cs +++ b/MapControl/MapPolyline.Silverlight.cs @@ -2,6 +2,7 @@ // Copyright © 2012 Clemens Fischer // Licensed under the Microsoft Public License (Ms-PL) +using System.Collections.Generic; using System.Windows; using System.Windows.Shapes; @@ -9,6 +10,10 @@ namespace MapControl { public partial class MapPolyline : Path { + public static readonly DependencyProperty LocationsProperty = DependencyProperty.Register( + "Locations", typeof(ICollection), typeof(MapPolyline), + new PropertyMetadata(null, LocationsPropertyChanged)); + public MapPolyline() { Data = Geometry; diff --git a/MapControl/MapPolyline.WPF.cs b/MapControl/MapPolyline.WPF.cs index 72539030..7c8a072e 100644 --- a/MapControl/MapPolyline.WPF.cs +++ b/MapControl/MapPolyline.WPF.cs @@ -2,6 +2,7 @@ // Copyright © 2012 Clemens Fischer // Licensed under the Microsoft Public License (Ms-PL) +using System.Collections.Generic; using System.Windows; using System.Windows.Media; using System.Windows.Shapes; @@ -10,6 +11,10 @@ namespace MapControl { public partial class MapPolyline : Shape { + public static readonly DependencyProperty LocationsProperty = DependencyProperty.Register( + "Locations", typeof(ICollection), typeof(MapPolyline), + new PropertyMetadata(null, LocationsPropertyChanged)); + protected override Geometry DefiningGeometry { get { return Geometry; } diff --git a/MapControl/MapPolyline.WinRT.cs b/MapControl/MapPolyline.WinRT.cs index 7248276a..7b291237 100644 --- a/MapControl/MapPolyline.WinRT.cs +++ b/MapControl/MapPolyline.WinRT.cs @@ -2,12 +2,21 @@ // Copyright © 2012 Clemens Fischer // Licensed under the Microsoft Public License (Ms-PL) +using Windows.UI.Xaml; using Windows.UI.Xaml.Shapes; namespace MapControl { public partial class MapPolyline : Path { + /// + /// Property type declared as object instead of IEnumerable. + /// See here: http://stackoverflow.com/q/10544084/1136211 + /// + public static readonly DependencyProperty LocationsProperty = DependencyProperty.Register( + "Locations", typeof(object), typeof(MapPolyline), + new PropertyMetadata(null, LocationsPropertyChanged)); + public MapPolyline() { Data = Geometry; diff --git a/MapControl/MapPolyline.cs b/MapControl/MapPolyline.cs index e912e8ca..49831f16 100644 --- a/MapControl/MapPolyline.cs +++ b/MapControl/MapPolyline.cs @@ -2,6 +2,7 @@ // Copyright © 2012 Clemens Fischer // Licensed under the Microsoft Public License (Ms-PL) +using System; using System.Linq; using System.Collections.Generic; using System.Collections.Specialized; @@ -17,10 +18,6 @@ namespace MapControl { public partial class MapPolyline : IMapElement { - public static readonly DependencyProperty LocationsProperty = DependencyProperty.Register( - "Locations", typeof(IEnumerable), typeof(MapPolyline), - new PropertyMetadata(null, LocationsPropertyChanged)); - public static readonly DependencyProperty IsClosedProperty = DependencyProperty.Register( "IsClosed", typeof(bool), typeof(MapPolyline), new PropertyMetadata(false, (o, e) => ((MapPolyline)o).UpdateGeometry())); diff --git a/MapControl/WinRT/MapControl.WinRT.csproj b/MapControl/WinRT/MapControl.WinRT.csproj index 7f94d4ce..2befaf09 100644 --- a/MapControl/WinRT/MapControl.WinRT.csproj +++ b/MapControl/WinRT/MapControl.WinRT.csproj @@ -25,7 +25,7 @@ 4 - pdbonly + none true ..\bin\Release\ TRACE;NETFX_CORE