Version 4.7.1: Fixed MapOverlay Foreground and Stroke.

This commit is contained in:
ClemensF 2018-03-29 19:35:52 +02:00
parent 9566c2d708
commit de4ba0765a
13 changed files with 84 additions and 111 deletions

View file

@ -35,21 +35,17 @@ namespace MapControl
Data = new PathGeometry()
};
path.SetBinding(Shape.StrokeProperty,
GetBindingExpression(StrokeProperty)?.ParentBinding ??
new Binding
{
Source = this,
Path = new PropertyPath("Stroke")
});
path.SetBinding(Shape.StrokeProperty, new Binding
{
Source = this,
Path = new PropertyPath("Stroke")
});
path.SetBinding(Shape.StrokeThicknessProperty,
GetBindingExpression(StrokeThicknessProperty)?.ParentBinding ??
new Binding
{
Source = this,
Path = new PropertyPath("StrokeThickness")
});
path.SetBinding(Shape.StrokeThicknessProperty, new Binding
{
Source = this,
Path = new PropertyPath("StrokeThickness")
});
Children.Add(path);
}
@ -135,13 +131,11 @@ namespace MapControl
RenderTransform = renderTransform
};
label.SetBinding(TextBlock.ForegroundProperty,
GetBindingExpression(ForegroundProperty)?.ParentBinding ??
new Binding
{
Source = this,
Path = new PropertyPath("Foreground")
});
label.SetBinding(TextBlock.ForegroundProperty, new Binding
{
Source = this,
Path = new PropertyPath("Foreground")
});
Children.Add(label);
}

View file

@ -58,35 +58,13 @@ namespace MapControl
protected override void SetParentMap(MapBase parentMap)
{
if (GetBindingExpression(ForegroundProperty) != null)
if (parentMap != null && Foreground == null)
{
ClearValue(ForegroundProperty);
}
if (GetBindingExpression(StrokeProperty) != null)
{
ClearValue(StrokeProperty);
}
if (parentMap != null)
{
if (Foreground == null)
SetBinding(ForegroundProperty, new Binding
{
SetBinding(ForegroundProperty, new Binding
{
Source = parentMap,
Path = new PropertyPath("Foreground")
});
}
if (Stroke == null)
{
SetBinding(StrokeProperty, new Binding
{
Source = parentMap,
Path = new PropertyPath("Foreground")
});
}
Source = parentMap,
Path = new PropertyPath("Foreground")
});
}
base.SetParentMap(parentMap);

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("© 2018 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("4.7.0")]
[assembly: AssemblyFileVersion("4.7.0")]
[assembly: AssemblyVersion("4.7.1")]
[assembly: AssemblyFileVersion("4.7.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]