Update MapScale.cs

This commit is contained in:
Clemens 2021-12-01 20:39:42 +01:00
parent 928d12876f
commit 0b9b08586e

View file

@ -45,14 +45,19 @@ namespace MapControl
public MapScale() public MapScale()
{ {
MinWidth = 100d; MinWidth = 100d;
Children.Add(line);
Children.Add(label);
}
protected override void SetParentMap(MapBase map)
{
base.SetParentMap(map);
line.SetBinding(Shape.StrokeProperty, this.GetOrCreateBinding(StrokeProperty, nameof(Stroke))); line.SetBinding(Shape.StrokeProperty, this.GetOrCreateBinding(StrokeProperty, nameof(Stroke)));
line.SetBinding(Shape.StrokeThicknessProperty, this.GetOrCreateBinding(StrokeThicknessProperty, nameof(StrokeThickness))); line.SetBinding(Shape.StrokeThicknessProperty, this.GetOrCreateBinding(StrokeThicknessProperty, nameof(StrokeThickness)));
#if WINUI || UWP #if WINUI || UWP
label.SetBinding(TextBlock.ForegroundProperty, this.GetOrCreateBinding(ForegroundProperty, nameof(Foreground))); label.SetBinding(TextBlock.ForegroundProperty, this.GetOrCreateBinding(ForegroundProperty, nameof(Foreground)));
#endif #endif
Children.Add(line);
Children.Add(label);
} }
public Thickness Padding public Thickness Padding