mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Version 2.4.7: Added work-around for missing PropertyChangedCallback for the MapPath.Data property.
This commit is contained in:
parent
dfabb2a7eb
commit
e9868a993d
17 changed files with 80 additions and 36 deletions
|
|
@ -3,8 +3,12 @@
|
|||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
#if WINDOWS_RUNTIME
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Shapes;
|
||||
#else
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
#endif
|
||||
|
||||
|
|
@ -16,5 +20,24 @@ namespace MapControl
|
|||
{
|
||||
MapPanel.AddParentMapHandlers(this);
|
||||
}
|
||||
|
||||
private Geometry data;
|
||||
|
||||
protected override Size MeasureOverride(Size constraint)
|
||||
{
|
||||
// Work-around for missing PropertyChangedCallback for the Data property.
|
||||
if (data != Data)
|
||||
{
|
||||
data = Data;
|
||||
UpdateData();
|
||||
}
|
||||
|
||||
// Path.MeasureOverride in Windows Runtime sometimes returns an empty Size,
|
||||
// whereas in Silverlight it occasionally throws an ArgumentException,
|
||||
// apparently because it tries to create a Size from negative width or height,
|
||||
// which result from a transformed Geometry.
|
||||
// In either case it seems to be sufficient to simply return a non-zero size.
|
||||
return new Size(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,11 @@ namespace MapControl
|
|||
{
|
||||
get { return Data; }
|
||||
}
|
||||
|
||||
protected override Size MeasureOverride(Size constraint)
|
||||
{
|
||||
// Shape.MeasureOverride sometimes returns an empty Size.
|
||||
return new Size(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
#if WINDOWS_RUNTIME
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml.Media;
|
||||
#else
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
#endif
|
||||
|
||||
|
|
@ -44,15 +42,5 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override Size MeasureOverride(Size constraint)
|
||||
{
|
||||
// base.MeasureOverride in WPF and Windows Runtime sometimes return a Size
|
||||
// with zero width or height, whereas in Silverlight it occasionally throws
|
||||
// an ArgumentException, as it tries to create a Size from a negative width
|
||||
// or height, apparently resulting from a transformed Geometry.
|
||||
// In either case it seems to be sufficient to simply return a non-zero size.
|
||||
return new Size(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ using System.Windows;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.6")]
|
||||
[assembly: AssemblyFileVersion("2.4.6")]
|
||||
[assembly: AssemblyVersion("2.4.7")]
|
||||
[assembly: AssemblyFileVersion("2.4.7")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyCopyright("© 2015 Clemens Fischer")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyVersion("2.4.6")]
|
||||
[assembly: AssemblyFileVersion("2.4.6")]
|
||||
[assembly: AssemblyVersion("2.4.7")]
|
||||
[assembly: AssemblyFileVersion("2.4.7")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue