mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 22:46:58 +00:00
Avalonia using declarations
This commit is contained in:
parent
3d275cd924
commit
286b158abe
41 changed files with 87 additions and 145 deletions
|
|
@ -13,8 +13,6 @@ using System.Windows;
|
|||
using Windows.UI.Xaml;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Interactivity;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ using System.Windows.Media;
|
|||
using Windows.UI.Xaml.Media;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using ImageSource = Avalonia.Media.IImage;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
// Copyright © 2024 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System.IO;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public static class FilePath
|
||||
|
|
@ -11,9 +9,9 @@ namespace MapControl
|
|||
public static string GetFullPath(string path)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return Path.GetFullPath(path, System.AppDomain.CurrentDomain.BaseDirectory);
|
||||
return System.IO.Path.GetFullPath(path, System.AppDomain.CurrentDomain.BaseDirectory);
|
||||
#else
|
||||
return Path.GetFullPath(path);
|
||||
return System.IO.Path.GetFullPath(path);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Path = System.IO.Path;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -23,12 +24,6 @@ using Windows.UI.Xaml.Media;
|
|||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using FrameworkElement = Avalonia.Controls.Control;
|
||||
using ImageSource = Avalonia.Media.IImage;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using Microsoft.Extensions.Options;
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Path = System.IO.Path;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ using System.Windows.Media;
|
|||
using Windows.UI.Xaml.Media;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using ImageSource = Avalonia.Media.IImage;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Copyright © 2024 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
#if WPF
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
|
@ -13,10 +12,33 @@ using Windows.UI.Xaml.Media;
|
|||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Brush = Avalonia.Media.IBrush;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using UIElement = Avalonia.Controls.Control;
|
||||
global using Avalonia;
|
||||
global using Avalonia.Animation;
|
||||
global using Avalonia.Animation.Easings;
|
||||
global using Avalonia.Controls;
|
||||
global using Avalonia.Controls.Documents;
|
||||
global using Avalonia.Controls.Shapes;
|
||||
global using Avalonia.Data;
|
||||
global using Avalonia.Input;
|
||||
global using Avalonia.Interactivity;
|
||||
global using Avalonia.Media;
|
||||
global using Avalonia.Media.Imaging;
|
||||
global using Avalonia.Platform;
|
||||
global using Avalonia.Styling;
|
||||
global using Avalonia.Threading;
|
||||
global using Brush = Avalonia.Media.IBrush;
|
||||
global using ImageSource = Avalonia.Media.IImage;
|
||||
global using DependencyObject = Avalonia.AvaloniaObject;
|
||||
global using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
global using UIElement = Avalonia.Controls.Control;
|
||||
global using FrameworkElement = Avalonia.Controls.Control;
|
||||
global using HorizontalAlignment = Avalonia.Layout.HorizontalAlignment;
|
||||
global using VerticalAlignment = Avalonia.Layout.VerticalAlignment;
|
||||
global using PathFigureCollection = Avalonia.Media.PathFigures;
|
||||
global using PointCollection = System.Collections.Generic.List<Avalonia.Point>;
|
||||
global using PropertyPath = System.String;
|
||||
#endif
|
||||
using System;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ using System.Windows;
|
|||
using Windows.UI.Xaml;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using FrameworkElement = Avalonia.Controls.Control;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Media;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using PathFigureCollection = Avalonia.Media.PathFigures;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -20,13 +20,6 @@ using Microsoft.UI.Xaml;
|
|||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using DispatcherTimer = Microsoft.UI.Dispatching.DispatcherQueueTimer;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Threading;
|
||||
using Brush = Avalonia.Media.IBrush;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using ImageSource = Avalonia.Media.IImage;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -18,13 +18,6 @@ using Windows.Foundation;
|
|||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using FrameworkElement = Avalonia.Controls.Control;
|
||||
using HorizontalAlignment = Avalonia.Layout.HorizontalAlignment;
|
||||
using VerticalAlignment = Avalonia.Layout.VerticalAlignment;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -43,17 +36,6 @@ namespace MapControl
|
|||
|
||||
public partial class MapPanel : Panel, IMapElement
|
||||
{
|
||||
public static readonly DependencyProperty AutoCollapseProperty =
|
||||
DependencyPropertyHelper.RegisterAttached<MapPanel, bool>("AutoCollapse");
|
||||
|
||||
public static readonly DependencyProperty LocationProperty =
|
||||
DependencyPropertyHelper.RegisterAttached<MapPanel, Location>("Location", null,
|
||||
(element, oldValue, newValue) => (element.Parent as MapPanel)?.InvalidateArrange());
|
||||
|
||||
public static readonly DependencyProperty BoundingBoxProperty =
|
||||
DependencyPropertyHelper.RegisterAttached<MapPanel, BoundingBox>("BoundingBox", null,
|
||||
(element, oldValue, newValue) => (element.Parent as MapPanel)?.InvalidateArrange());
|
||||
|
||||
private static readonly DependencyProperty ViewPositionProperty =
|
||||
DependencyPropertyHelper.RegisterAttached<MapPanel, Point?>("ViewPosition");
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using PathFigureCollection = Avalonia.Media.PathFigures;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ using System.Windows;
|
|||
using Windows.UI.Xaml;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ using System.Windows;
|
|||
using Windows.UI.Xaml;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -24,14 +24,6 @@ using Microsoft.UI.Xaml.Controls;
|
|||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Shapes;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Shapes;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using HorizontalAlignment = Avalonia.Layout.HorizontalAlignment;
|
||||
using VerticalAlignment = Avalonia.Layout.VerticalAlignment;
|
||||
using PointCollection = System.Collections.Generic.List<Avalonia.Point>;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
@ -78,19 +70,12 @@ namespace MapControl
|
|||
{
|
||||
base.SetParentMap(map);
|
||||
|
||||
#if AVALONIA
|
||||
line.Bind(Shape.StrokeProperty,
|
||||
new Binding { Source = map, Path = nameof(MapBase.Foreground) });
|
||||
|
||||
line.Bind(Shape.StrokeThicknessProperty,
|
||||
new Binding { Source = this, Path = nameof(StrokeThickness) });
|
||||
#else
|
||||
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)) });
|
||||
#endif
|
||||
|
||||
#if UWP || WINUI
|
||||
label.SetBinding(TextBlock.ForegroundProperty,
|
||||
new Binding { Source = map, Path = new PropertyPath(nameof(MapBase.Foreground)) });
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ using Windows.UI.Xaml.Media;
|
|||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Media;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -19,12 +19,6 @@ using Microsoft.UI.Xaml;
|
|||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using DispatcherTimer = Microsoft.UI.Dispatching.DispatcherQueueTimer;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Threading;
|
||||
using Brush = Avalonia.Media.IBrush;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -14,9 +14,6 @@ using Windows.UI.Xaml.Media;
|
|||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Media;
|
||||
using HorizontalAlignment = Avalonia.Layout.HorizontalAlignment;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using ImageSource = Avalonia.Media.IImage;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ using System;
|
|||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -147,7 +146,7 @@ namespace MapControl
|
|||
|
||||
private static async Task LoadCachedTileAsync(Tile tile, Uri uri, string cacheName)
|
||||
{
|
||||
var extension = Path.GetExtension(uri.LocalPath);
|
||||
var extension = System.IO.Path.GetExtension(uri.LocalPath);
|
||||
|
||||
if (string.IsNullOrEmpty(extension) || extension.Equals(".jpeg", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ using System.Windows.Media;
|
|||
using Windows.UI.Xaml.Media;
|
||||
#elif WINUI
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using ImageSource = Avalonia.Media.IImage;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ using System.Windows;
|
|||
using System.Windows.Threading;
|
||||
#elif UWP
|
||||
using Windows.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Threading;
|
||||
using DependencyObject = Avalonia.AvaloniaObject;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ using Windows.UI.Xaml.Media;
|
|||
#elif WINUI
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
using ImageSource = Avalonia.Media.IImage;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ using Windows.UI.Xaml;
|
|||
#elif WINUI
|
||||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Interactivity;
|
||||
using DependencyProperty = Avalonia.AvaloniaProperty;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
|
|
@ -15,9 +15,6 @@ using Windows.UI.Xaml.Media;
|
|||
using Windows.Foundation;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#elif AVALONIA
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue