Code style

This commit is contained in:
ClemensFischer 2025-06-06 11:39:26 +02:00
parent e3b221a80b
commit bcd12ba5b8
3 changed files with 13 additions and 29 deletions

View file

@ -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) });
}
}

View file

@ -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)) });

View file

@ -39,29 +39,17 @@ namespace MapControl
Stretch = Stretch.None
};
path.SetBinding(Shape.FillProperty, new Binding
{
Path = new PropertyPath(nameof(Background)),
Source = this
});
path.SetBinding(Shape.FillProperty,
new Binding { Source = this, Path = new PropertyPath(nameof(Background)) });
path.SetBinding(Shape.StrokeProperty, new Binding
{
Path = new PropertyPath(nameof(BorderBrush)),
Source = this
});
path.SetBinding(Shape.StrokeProperty,
new Binding { Source = this, Path = new PropertyPath(nameof(BorderBrush)) });
path.SetBinding(Shape.StrokeThicknessProperty, new Binding
{
Path = new PropertyPath(nameof(BorderWidth)),
Source = this
});
path.SetBinding(Shape.StrokeThicknessProperty,
new Binding { Source = this, Path = new PropertyPath(nameof(BorderWidth)) });
border.SetBinding(PaddingProperty, new Binding
{
Path = new PropertyPath(nameof(Padding)),
Source = this
});
border.SetBinding(PaddingProperty,
new Binding { Source = this, Path = new PropertyPath(nameof(Padding)) });
SetBorderMargin();