From bcd12ba5b8b60611c7e3e7b42fa8a52223fece08 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Fri, 6 Jun 2025 11:39:26 +0200 Subject: [PATCH] Code style --- MapControl/Shared/MapItemsControl.cs | 6 +---- MapControl/Shared/MapScale.cs | 6 ++--- MapControl/WinUI/PushpinBorder.WinUI.cs | 30 ++++++++----------------- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/MapControl/Shared/MapItemsControl.cs b/MapControl/Shared/MapItemsControl.cs index d66b6cbf..8842f792 100644 --- a/MapControl/Shared/MapItemsControl.cs +++ b/MapControl/Shared/MapItemsControl.cs @@ -123,11 +123,7 @@ namespace MapControl if (LocationMemberPath != null && container is MapItem mapItem) { mapItem.SetBinding(MapItem.LocationProperty, - new Binding - { - Path = new PropertyPath(LocationMemberPath), - Source = item - }); + new Binding { Source = item, Path = new PropertyPath(LocationMemberPath) }); } } diff --git a/MapControl/Shared/MapScale.cs b/MapControl/Shared/MapScale.cs index 70c90d99..11ca178c 100644 --- a/MapControl/Shared/MapScale.cs +++ b/MapControl/Shared/MapScale.cs @@ -68,12 +68,12 @@ namespace MapControl { base.SetParentMap(map); - line.SetBinding(Shape.StrokeProperty, - new Binding { Source = map, Path = new PropertyPath(nameof(MapBase.Foreground)) }); - line.SetBinding(Shape.StrokeThicknessProperty, new Binding { Source = this, Path = new PropertyPath(nameof(StrokeThickness)) }); + line.SetBinding(Shape.StrokeProperty, + new Binding { Source = map, Path = new PropertyPath(nameof(MapBase.Foreground)) }); + #if UWP || WINUI label.SetBinding(TextBlock.ForegroundProperty, new Binding { Source = map, Path = new PropertyPath(nameof(MapBase.Foreground)) }); diff --git a/MapControl/WinUI/PushpinBorder.WinUI.cs b/MapControl/WinUI/PushpinBorder.WinUI.cs index 842ba550..0ea7956c 100644 --- a/MapControl/WinUI/PushpinBorder.WinUI.cs +++ b/MapControl/WinUI/PushpinBorder.WinUI.cs @@ -38,30 +38,18 @@ namespace MapControl VerticalAlignment = VerticalAlignment.Stretch, Stretch = Stretch.None }; - - path.SetBinding(Shape.FillProperty, new Binding - { - Path = new PropertyPath(nameof(Background)), - Source = this - }); - path.SetBinding(Shape.StrokeProperty, new Binding - { - Path = new PropertyPath(nameof(BorderBrush)), - Source = this - }); + path.SetBinding(Shape.FillProperty, + new Binding { Source = this, Path = new PropertyPath(nameof(Background)) }); - path.SetBinding(Shape.StrokeThicknessProperty, new Binding - { - Path = new PropertyPath(nameof(BorderWidth)), - Source = this - }); + path.SetBinding(Shape.StrokeProperty, + new Binding { Source = this, Path = new PropertyPath(nameof(BorderBrush)) }); - border.SetBinding(PaddingProperty, new Binding - { - Path = new PropertyPath(nameof(Padding)), - Source = this - }); + path.SetBinding(Shape.StrokeThicknessProperty, + new Binding { Source = this, Path = new PropertyPath(nameof(BorderWidth)) }); + + border.SetBinding(PaddingProperty, + new Binding { Source = this, Path = new PropertyPath(nameof(Padding)) }); SetBorderMargin();