From 0b9b08586ee79490815e9426d7dd1a511a25d660 Mon Sep 17 00:00:00 2001 From: Clemens Date: Wed, 1 Dec 2021 20:39:42 +0100 Subject: [PATCH] Update MapScale.cs --- MapControl/Shared/MapScale.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MapControl/Shared/MapScale.cs b/MapControl/Shared/MapScale.cs index 989468c1..39a976e8 100644 --- a/MapControl/Shared/MapScale.cs +++ b/MapControl/Shared/MapScale.cs @@ -45,14 +45,19 @@ namespace MapControl public MapScale() { 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.StrokeThicknessProperty, this.GetOrCreateBinding(StrokeThicknessProperty, nameof(StrokeThickness))); #if WINUI || UWP label.SetBinding(TextBlock.ForegroundProperty, this.GetOrCreateBinding(ForegroundProperty, nameof(Foreground))); #endif - Children.Add(line); - Children.Add(label); } public Thickness Padding