Simplified new expressions

This commit is contained in:
ClemensFischer 2025-11-15 00:33:32 +01:00
parent ae0ebc6fdb
commit 2ec8b1b987
6 changed files with 7 additions and 7 deletions

View file

@ -12,7 +12,7 @@ namespace MapControl
public class ImageTile(int zoomLevel, int x, int y, int columnCount)
: Tile(zoomLevel, x, y, columnCount)
{
public Image Image { get; } = new Image { Stretch = Stretch.Fill };
public Image Image { get; } = new() { Stretch = Stretch.Fill };
public override async Task LoadImageAsync(Func<Task<IImage>> loadImageFunc)
{

View file

@ -39,7 +39,7 @@ namespace MapControl
public string ImagePath { get; }
public Image Image { get; } = new Image { Stretch = Stretch.Fill };
public Image Image { get; } = new() { Stretch = Stretch.Fill };
public async Task LoadImage(Uri docUri)
{

View file

@ -174,7 +174,7 @@ namespace MapControl
/// Gets the ViewTransform instance that is used to transform between projected
/// map coordinates and view coordinates.
/// </summary>
public ViewTransform ViewTransform { get; } = new ViewTransform();
public ViewTransform ViewTransform { get; } = new();
/// <summary>
/// Gets the map scale as horizontal and vertical scaling factors from meters to

View file

@ -55,9 +55,9 @@ namespace MapControl
set => SetValue(StrokeThicknessProperty, value);
}
private readonly Polyline line = new Polyline();
private readonly Polyline line = new ();
private readonly TextBlock label = new TextBlock
private readonly TextBlock label = new()
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center

View file

@ -11,7 +11,7 @@ namespace MapControl
public class ImageTile(int zoomLevel, int x, int y, int columnCount)
: Tile(zoomLevel, x, y, columnCount)
{
public Image Image { get; } = new Image { Stretch = Stretch.Fill };
public Image Image { get; } = new() { Stretch = Stretch.Fill };
public override async Task LoadImageAsync(Func<Task<ImageSource>> loadImageFunc)
{

View file

@ -21,7 +21,7 @@ namespace MapControl
public class ImageTile(int zoomLevel, int x, int y, int columnCount)
: Tile(zoomLevel, x, y, columnCount)
{
public Image Image { get; } = new Image { Stretch = Stretch.Fill };
public Image Image { get; } = new() { Stretch = Stretch.Fill };
public override async Task LoadImageAsync(Func<Task<ImageSource>> loadImageFunc)
{