XAML-Map-Control/MapControl/MapPath.cs
ClemensF 8917e1d4cb Version 2.2.0:
- IMapElement interface with readonly ParentMap property and SetParentMap method that is explicitly implemented
- Removed MetersPerDegree from MapBase
- Set StrokeThickness instead of Stroke in MapGraticule ctor in SL/WinRT
2014-07-22 20:02:30 +02:00

46 lines
1.2 KiB
C#

// XAML Map Control - http://xamlmapcontrol.codeplex.com/
// Copyright © 2014 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINDOWS_RUNTIME
using Windows.Foundation;
#else
using System.Windows;
#endif
namespace MapControl
{
/// <summary>
/// Base class for map shapes.
/// </summary>
public partial class MapPath : IMapElement
{
private MapBase parentMap;
public MapBase ParentMap
{
get { return parentMap; }
}
void IMapElement.SetParentMap(MapBase map)
{
parentMap = map;
UpdateData();
}
protected virtual void UpdateData()
{
}
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);
}
}
}