Avalonia using declarations

This commit is contained in:
ClemensFischer 2024-05-27 11:05:22 +02:00
parent 3d275cd924
commit 286b158abe
41 changed files with 87 additions and 145 deletions

View file

@ -2,7 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Controls;
using System;
#pragma warning disable AVP1001 // The same AvaloniaProperty should not be registered twice
@ -82,5 +81,10 @@ namespace MapControl
{
return AddOwner<TOwner, TValue>((StyledProperty<TValue>)property);
}
public static void SetBinding(this AvaloniaObject target, AvaloniaProperty property, Binding binding)
{
target.Bind(property, binding);
}
}
}

View file

@ -2,9 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Media;
using Avalonia.Media.Imaging;
using Avalonia.Platform;
using System;
using System.IO;
using System.Threading.Tasks;

View file

@ -2,8 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Animation;
namespace MapControl
{
public class LocationAnimator : InterpolatingAnimator<Location>

View file

@ -2,7 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Input;
using System;
namespace MapControl

View file

@ -2,13 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
global using Avalonia;
using Avalonia.Animation;
using Avalonia.Animation.Easings;
using Avalonia.Controls;
using Avalonia.Controls.Documents;
using Avalonia.Media;
using Avalonia.Styling;
using System.Threading;
using System.Threading.Tasks;

View file

@ -2,8 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Controls;
namespace MapControl
{
/// <summary>

View file

@ -2,10 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Controls;
using Avalonia.Controls.Documents;
using Avalonia.Controls.Shapes;
using Avalonia.Media;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

View file

@ -2,13 +2,24 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Controls;
using Avalonia.Media;
namespace MapControl
{
public partial class MapPanel
{
public static readonly AttachedProperty<bool> AutoCollapseProperty =
DependencyPropertyHelper.RegisterAttached<MapPanel, bool>("AutoCollapse");
public static readonly AttachedProperty<Location> LocationProperty =
DependencyPropertyHelper.RegisterAttached<MapPanel, Location>("Location");
public static readonly AttachedProperty<BoundingBox> BoundingBoxProperty =
DependencyPropertyHelper.RegisterAttached<MapPanel, BoundingBox>("BoundingBox");
static MapPanel()
{
AffectsParentArrange<MapPanel>(LocationProperty, BoundingBoxProperty);
}
public MapPanel()
{
if (this is MapBase mapBase)

View file

@ -2,9 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Controls.Shapes;
using Avalonia.Media;
namespace MapControl
{
public partial class MapPath : Shape

View file

@ -2,7 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Media;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;

View file

@ -4,10 +4,6 @@
using System.Threading.Tasks;
using System;
using Avalonia.Controls;
using Avalonia.Animation;
using Avalonia.Styling;
using System.Xml.Linq;
namespace MapControl
{

View file

@ -2,8 +2,6 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Controls;
using Avalonia.Media;
using System;
namespace MapControl

View file

@ -2,10 +2,7 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using Avalonia.Media;
using Avalonia.Threading;
using System;
using System.IO;
using System.Threading.Tasks;
namespace MapControl
@ -16,7 +13,7 @@ namespace MapControl
/// Default folder where the Cache instance may save data, i.e. "C:\ProgramData\MapControl\TileCache".
/// </summary>
public static string DefaultCacheFolder =>
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MapControl", "TileCache");
System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MapControl", "TileCache");
private static async Task LoadTileAsync(Tile tile, Func<Task<IImage>> loadImageFunc)