2013-05-25 08:53:50 +02:00
|
|
|
|
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
2015-01-20 17:52:02 +01:00
|
|
|
|
// © 2015 Clemens Fischer
|
2013-05-25 08:53:50 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class MapPath : Shape
|
|
|
|
|
|
{
|
|
|
|
|
|
public static readonly DependencyProperty DataProperty = DependencyProperty.Register(
|
2015-02-10 17:25:00 +01:00
|
|
|
|
"Data", typeof(Geometry), typeof(MapPath), new FrameworkPropertyMetadata(
|
|
|
|
|
|
null, FrameworkPropertyMetadataOptions.AffectsRender, (o, e) => ((MapPath)o).UpdateData()));
|
2013-05-25 08:53:50 +02:00
|
|
|
|
|
|
|
|
|
|
public Geometry Data
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (Geometry)GetValue(DataProperty); }
|
|
|
|
|
|
set { SetValue(DataProperty, value); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override Geometry DefiningGeometry
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Data; }
|
|
|
|
|
|
}
|
2015-02-10 21:59:39 +01:00
|
|
|
|
|
|
|
|
|
|
protected override Size MeasureOverride(Size constraint)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Shape.MeasureOverride sometimes returns an empty Size.
|
|
|
|
|
|
return new Size(1, 1);
|
|
|
|
|
|
}
|
2013-05-25 08:53:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|