2017-06-25 23:05:48 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
|
|
|
|
|
// © 2017 Clemens Fischer
|
2014-07-01 18:57:44 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class MapOverlay
|
|
|
|
|
|
{
|
2017-08-08 21:24:51 +02:00
|
|
|
|
public static readonly DependencyProperty FontSizeProperty = Control.FontSizeProperty.AddOwner(typeof(MapOverlay));
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
2017-08-08 21:24:51 +02:00
|
|
|
|
public static readonly DependencyProperty FontFamilyProperty = Control.FontFamilyProperty.AddOwner(typeof(MapOverlay));
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
2017-08-08 21:24:51 +02:00
|
|
|
|
public static readonly DependencyProperty FontStyleProperty = Control.FontStyleProperty.AddOwner(typeof(MapOverlay));
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
2017-08-08 21:24:51 +02:00
|
|
|
|
public static readonly DependencyProperty FontStretchProperty = Control.FontStretchProperty.AddOwner(typeof(MapOverlay));
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
2017-08-08 21:24:51 +02:00
|
|
|
|
public static readonly DependencyProperty FontWeightProperty = Control.FontWeightProperty.AddOwner(typeof(MapOverlay));
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
2017-08-08 21:24:51 +02:00
|
|
|
|
public static readonly DependencyProperty ForegroundProperty = Control.ForegroundProperty.AddOwner(typeof(MapOverlay));
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeProperty = Shape.StrokeProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeThicknessProperty = Shape.StrokeThicknessProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeDashArrayProperty = Shape.StrokeDashArrayProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeDashOffsetProperty = Shape.StrokeDashOffsetProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeDashCapProperty = Shape.StrokeDashCapProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeStartLineCapProperty = Shape.StrokeStartLineCapProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeEndLineCapProperty = Shape.StrokeEndLineCapProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeLineJoinProperty = Shape.StrokeLineJoinProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty StrokeMiterLimitProperty = Shape.StrokeMiterLimitProperty.AddOwner(
|
2017-08-08 21:24:51 +02:00
|
|
|
|
typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true });
|
2014-07-01 18:57:44 +02:00
|
|
|
|
|
2017-08-08 21:24:51 +02:00
|
|
|
|
protected Typeface CreateTypeface()
|
2014-07-01 18:57:44 +02:00
|
|
|
|
{
|
2017-08-08 21:24:51 +02:00
|
|
|
|
return new Typeface(FontFamily, FontStyle, FontWeight, FontStretch);
|
2014-07-01 18:57:44 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-08-08 21:24:51 +02:00
|
|
|
|
protected Pen CreatePen()
|
2014-07-01 18:57:44 +02:00
|
|
|
|
{
|
2017-08-08 21:24:51 +02:00
|
|
|
|
return new Pen
|
2014-07-01 18:57:44 +02:00
|
|
|
|
{
|
2017-08-08 21:24:51 +02:00
|
|
|
|
Brush = Stroke ?? Foreground,
|
|
|
|
|
|
Thickness = StrokeThickness,
|
|
|
|
|
|
DashStyle = new DashStyle(StrokeDashArray, StrokeDashOffset),
|
|
|
|
|
|
DashCap = StrokeDashCap,
|
|
|
|
|
|
StartLineCap = StrokeStartLineCap,
|
|
|
|
|
|
EndLineCap = StrokeEndLineCap,
|
|
|
|
|
|
LineJoin = StrokeLineJoin,
|
|
|
|
|
|
MiterLimit = StrokeMiterLimit
|
|
|
|
|
|
};
|
2014-07-01 18:57:44 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|