2013-04-12 19:59:16 +02:00
|
|
|
|
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
2013-05-07 18:12:25 +02:00
|
|
|
|
// Copyright © Clemens Fischer 2012-2013
|
2013-04-12 19:59:16 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
#if NETFX_CORE
|
|
|
|
|
|
using Windows.Foundation;
|
|
|
|
|
|
#else
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Base class for map shapes.
|
|
|
|
|
|
/// </summary>
|
2013-05-25 08:53:50 +02:00
|
|
|
|
public partial class MapPath : IMapElement
|
2013-04-12 19:59:16 +02:00
|
|
|
|
{
|
|
|
|
|
|
private MapBase parentMap;
|
|
|
|
|
|
|
|
|
|
|
|
public MapBase ParentMap
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return parentMap; }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
parentMap = value;
|
2013-05-25 08:53:50 +02:00
|
|
|
|
UpdateData();
|
2013-04-12 19:59:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-05-25 08:53:50 +02:00
|
|
|
|
protected virtual void UpdateData()
|
2013-04-12 19:59:16 +02:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override Size MeasureOverride(Size constraint)
|
|
|
|
|
|
{
|
2013-05-25 08:53:50 +02:00
|
|
|
|
// base.MeasureOverride in WPF and WinRT sometimes return a Size with zero
|
|
|
|
|
|
// width or height, whereas base.MeasureOverride in Silverlight occasionally
|
2013-04-12 19:59:16 +02:00
|
|
|
|
// 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);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|