XAML-Map-Control/MapControl/MapPath.WPF.cs

35 lines
1 KiB
C#
Raw Normal View History

// XAML Map Control - http://xamlmapcontrol.codeplex.com/
2015-01-20 17:52:02 +01:00
// © 2015 Clemens Fischer
// 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(
"Data", typeof(Geometry), typeof(MapPath), new FrameworkPropertyMetadata(
null, FrameworkPropertyMetadataOptions.AffectsRender, (o, e) => ((MapPath)o).UpdateData()));
public Geometry Data
{
get { return (Geometry)GetValue(DataProperty); }
set { SetValue(DataProperty, value); }
}
protected override Geometry DefiningGeometry
{
get { return Data; }
}
protected override Size MeasureOverride(Size constraint)
{
// Shape.MeasureOverride sometimes returns an empty Size.
return new Size(1, 1);
}
}
}