Version 4.9.0: Reworked MapPanel child arrangement.

This commit is contained in:
ClemensF 2018-05-01 12:45:19 +02:00
parent ea2cd438fa
commit 452e2a5454
9 changed files with 104 additions and 172 deletions

View file

@ -4,18 +4,19 @@
using Windows.UI.Text;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;
namespace MapControl
{
public partial class MapOverlay
{
public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register(
nameof(FontSize), typeof(double), typeof(MapOverlay), new PropertyMetadata(12d));
public static readonly DependencyProperty FontFamilyProperty = DependencyProperty.Register(
nameof(FontFamily), typeof(FontFamily), typeof(MapOverlay), new PropertyMetadata(null));
public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register(
nameof(FontSize), typeof(double), typeof(MapOverlay), new PropertyMetadata(12d));
public static readonly DependencyProperty FontStyleProperty = DependencyProperty.Register(
nameof(FontStyle), typeof(FontStyle), typeof(MapOverlay), new PropertyMetadata(FontStyle.Normal));
@ -54,5 +55,17 @@ namespace MapControl
public static readonly DependencyProperty StrokeMiterLimitProperty = DependencyProperty.Register(
nameof(StrokeMiterLimit), typeof(double), typeof(MapOverlay), new PropertyMetadata(1d));
protected override void SetParentMap(MapBase map)
{
if (Foreground == null && map != null)
{
SetBinding(ForegroundProperty,
map.GetBindingExpression(MapBase.ForegroundProperty)?.ParentBinding ??
new Binding { Source = map, Path = new PropertyPath("Foreground") });
}
base.SetParentMap(map);
}
}
}