Conditional usings

This commit is contained in:
ClemensFischer 2024-05-22 11:25:32 +02:00
parent 93b58fa01e
commit eb990ab9ee
74 changed files with 354 additions and 364 deletions

View file

@ -3,12 +3,12 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System.Threading.Tasks;
#if WINUI
using Microsoft.UI.Xaml;
#if WPF
using System.Windows;
#elif UWP
using Windows.UI.Xaml;
#else
using System.Windows;
#elif WINUI
using Microsoft.UI.Xaml;
#endif
namespace MapControl.MBTiles

View file

@ -5,12 +5,12 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
#if WINUI
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml.Media;
#else
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl.MBTiles

View file

@ -13,7 +13,7 @@
<DelaySign>false</DelaySign>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageId>XAML.MapControl.MBTiles</PackageId>
<DefineConstants></DefineConstants>
<DefineConstants>WPF</DefineConstants>
</PropertyGroup>
<ItemGroup>

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -2,15 +2,15 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
#if WPF
using System.Windows;
using System.Windows.Data;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
#else
using System.Windows;
using System.Windows.Data;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
#endif
namespace MapControl

View file

@ -7,12 +7,12 @@ using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
#if WINUI
using Microsoft.UI.Xaml;
#if WPF
using System.Windows;
#elif UWP
using Windows.UI.Xaml;
#else
using System.Windows;
#elif WINUI
using Microsoft.UI.Xaml;
#endif
namespace MapControl

View file

@ -10,7 +10,7 @@ namespace MapControl
/// <summary>
/// A geographic bounding box with south and north latitude and west and east longitude values in degrees.
/// </summary>
#if WINUI || UWP
#if UWP || WINUI
[Windows.Foundation.Metadata.CreateFromString(MethodName = "Parse")]
#else
[System.ComponentModel.TypeConverter(typeof(BoundingBoxConverter))]

View file

@ -5,12 +5,12 @@
using System;
using System.Globalization;
using System.Threading.Tasks;
#if WINUI
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml.Media;
#else
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -4,7 +4,7 @@
using System;
using System.Globalization;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -7,21 +7,21 @@ using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
#endif
namespace MapControl

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -11,18 +11,18 @@ using System.IO.Compression;
using System.Linq;
using System.Threading.Tasks;
using System.Xml;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -9,14 +9,14 @@ using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
#if AVALONIA
using ImageSource = Avalonia.Media.IImage;
#elif WINUI
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml.Media;
#else
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml.Media;
#elif AVALONIA
using ImageSource = Avalonia.Media.IImage;
#endif
namespace MapControl

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -10,7 +10,7 @@ namespace MapControl
/// <summary>
/// A geographic location with latitude and longitude values in degrees.
/// </summary>
#if WINUI || UWP
#if UWP || WINUI
[Windows.Foundation.Metadata.CreateFromString(MethodName = "Parse")]
#else
[System.ComponentModel.TypeConverter(typeof(LocationConverter))]

View file

@ -12,7 +12,7 @@ namespace MapControl
/// A collection of Locations with support for string parsing
/// and calculation of great circle and rhumb line locations.
/// </summary>
#if WINUI || UWP
#if UWP || WINUI
[Windows.Foundation.Metadata.CreateFromString(MethodName = "Parse")]
#else
[System.ComponentModel.TypeConverter(typeof(LocationCollectionConverter))]

View file

@ -3,21 +3,21 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if AVALONIA
using Avalonia.Media;
using DependencyProperty = Avalonia.AvaloniaProperty;
using UIElement = Avalonia.Controls.Control;
#elif WINUI
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#elif AVALONIA
using Avalonia.Media;
using DependencyProperty = Avalonia.AvaloniaProperty;
using UIElement = Avalonia.Controls.Control;
#endif
namespace MapControl

View file

@ -2,12 +2,12 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI.Xaml;
#if WPF
using System.Windows;
#elif UWP
using Windows.UI.Xaml;
#else
using System.Windows;
#elif WINUI
using Microsoft.UI.Xaml;
#endif
namespace MapControl

View file

@ -6,17 +6,15 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
#if WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -6,28 +6,26 @@ using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
#if AVALONIA
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#elif WINUI
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 DependencyProperty = Avalonia.AvaloniaProperty;
using ImageSource = Avalonia.Media.IImage;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using DispatcherTimer = Microsoft.UI.Dispatching.DispatcherQueueTimer;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
#endif
namespace MapControl

View file

@ -2,15 +2,15 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows.Controls;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#else
using System.Windows.Controls;
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -3,20 +3,18 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
#else
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
#endif
namespace MapControl

View file

@ -2,15 +2,15 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI.Xaml.Media;
using Windows.UI.Text;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.UI.Text;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml.Media;
using Windows.UI.Text;
#endif
namespace MapControl

View file

@ -2,28 +2,27 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if AVALONIA
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#elif WINUI
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;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#endif
/// <summary>

View file

@ -4,16 +4,15 @@
using System.Collections.Generic;
using System.Linq;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -3,15 +3,15 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System.Collections.Generic;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl
@ -32,7 +32,7 @@ namespace MapControl
/// <summary>
/// Gets or sets the Locations that define the polygon points.
/// </summary>
#if !WINUI && !UWP
#if WPF
[System.ComponentModel.TypeConverter(typeof(LocationCollectionConverter))]
#endif
public IEnumerable<Location> Locations

View file

@ -3,15 +3,15 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System.Collections.Generic;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl
@ -32,7 +32,7 @@ namespace MapControl
/// <summary>
/// Gets or sets the Locations that define the polyline points.
/// </summary>
#if !WINUI && !UWP
#if WPF
[System.ComponentModel.TypeConverter(typeof(LocationCollectionConverter))]
#endif
public IEnumerable<Location> Locations

View file

@ -4,7 +4,7 @@
using System;
using System.Globalization;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -4,23 +4,23 @@
using System;
using System.Globalization;
#if WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#endif
namespace MapControl
@ -56,7 +56,7 @@ namespace MapControl
line.SetBinding(Shape.StrokeProperty, this.GetOrCreateBinding(StrokeProperty, nameof(Stroke)));
line.SetBinding(Shape.StrokeThicknessProperty, this.GetOrCreateBinding(StrokeThicknessProperty, nameof(StrokeThickness)));
#if WINUI || UWP
#if UWP || WINUI
label.SetBinding(TextBlock.ForegroundProperty, this.GetOrCreateBinding(ForegroundProperty, nameof(Foreground)));
#endif
}

View file

@ -4,20 +4,20 @@
using System;
using System.Threading.Tasks;
#if AVALONIA
using Avalonia.Media;
using DependencyProperty = Avalonia.AvaloniaProperty;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#elif AVALONIA
using Avalonia.Media;
using DependencyProperty = Avalonia.AvaloniaProperty;
#endif
namespace MapControl

View file

@ -5,25 +5,25 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
#if AVALONIA
using Avalonia.Controls;
using Avalonia.Media;
using Avalonia.Threading;
using DependencyProperty = Avalonia.AvaloniaProperty;
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using DispatcherTimer = Microsoft.UI.Dispatching.DispatcherQueueTimer;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
#elif AVALONIA
using Avalonia.Controls;
using Avalonia.Media;
using Avalonia.Threading;
using DependencyProperty = Avalonia.AvaloniaProperty;
#endif
namespace MapControl
@ -72,7 +72,7 @@ namespace MapControl
updateTimer = this.CreateTimer(UpdateInterval);
updateTimer.Tick += async (s, e) => await Update(false);
#if WINUI || UWP
#if UWP || WINUI
MapPanel.InitMapElement(this);
#endif
}

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,17 +3,17 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,19 +3,19 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if AVALONIA
using Avalonia.Controls;
using Avalonia.Media;
using ImageSource = Avalonia.Media.IImage;
#elif WINUI
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows.Controls;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#else
using System.Windows.Controls;
using System.Windows.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

View file

@ -4,14 +4,14 @@
using System;
using System.Threading.Tasks;
#if AVALONIA
using ImageSource = Avalonia.Media.IImage;
#elif WINUI
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml.Media;
#else
using System.Windows.Media;
#elif WINUI
using Microsoft.UI.Xaml.Media;
#elif AVALONIA
using ImageSource = Avalonia.Media.IImage;
#endif
namespace MapControl
@ -19,7 +19,7 @@ namespace MapControl
/// <summary>
/// Provides the download Uri or ImageSource of map tiles.
/// </summary>
#if WINUI || UWP
#if UWP || WINUI
[Windows.Foundation.Metadata.CreateFromString(MethodName = "Parse")]
#else
[System.ComponentModel.TypeConverter(typeof(TileSourceConverter))]

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -2,7 +2,7 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,15 +3,15 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Media;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -8,18 +8,18 @@ using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
#if AVALONIA
using DependencyProperty = Avalonia.AvaloniaProperty;
using ImageSource = Avalonia.Media.IImage;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Media;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.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

View file

@ -8,7 +8,7 @@ using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -7,14 +7,14 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
#if WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
#if WPF
using System.Windows;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml;
#else
using System.Windows;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml;
#endif
namespace MapControl

View file

@ -2,7 +2,7 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,18 +3,18 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#if WPF
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#elif UWP
using Windows.Foundation;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
#elif WINUI
using Windows.Foundation;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -13,7 +13,7 @@
<DelaySign>false</DelaySign>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageId>XAML.MapControl</PackageId>
<DefineConstants></DefineConstants>
<DefineConstants>WPF</DefineConstants>
</PropertyGroup>
<ItemGroup>

View file

@ -3,12 +3,12 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if AVALONIA
using Avalonia.Threading;
#if WPF
using System.Windows.Threading;
#elif UWP
using Windows.UI.Xaml;
#else
using System.Windows.Threading;
#elif AVALONIA
using Avalonia.Threading;
#endif
namespace MapControl

View file

@ -3,10 +3,10 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if WINUI
using Microsoft.UI.Xaml;
#else
#if UWP
using Windows.UI.Xaml;
#else
using Microsoft.UI.Xaml;
#endif
#pragma warning disable IDE0060 // Remove unused parameter

View file

@ -9,12 +9,12 @@ using System.Threading.Tasks;
using Windows.Graphics.Imaging;
using Windows.Storage;
using Windows.Storage.Streams;
#if WINUI
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
#else
#if UWP
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
#else
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
#endif
namespace MapControl

View file

@ -4,14 +4,14 @@
using System;
using Windows.System;
#if WINUI
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
#else
#if UWP
using Windows.Devices.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
#else
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
#endif
namespace MapControl

View file

@ -2,16 +2,16 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Animation;
#else
#if UWP
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
#else
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Animation;
#endif
namespace MapControl

View file

@ -2,12 +2,12 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#else
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
#endif
namespace MapControl

View file

@ -5,14 +5,14 @@
using Windows.Foundation;
using System.Collections.Generic;
using System.Linq;
#if WINUI
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#else
#if UWP
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
#else
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#endif
namespace MapControl

View file

@ -3,14 +3,14 @@
// Licensed under the Microsoft Public License (Ms-PL)
using Windows.System;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
#else
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
#endif
namespace MapControl

View file

@ -2,10 +2,10 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI.Xaml;
#else
#if UWP
using Windows.UI.Xaml;
#else
using Microsoft.UI.Xaml;
#endif
namespace MapControl

View file

@ -2,15 +2,14 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Windows.UI.Text;
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using Microsoft.UI.Text;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Windows.UI.Text;
#else
using Windows.UI.Text;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -4,12 +4,12 @@
using System.Collections.Generic;
using System.Linq;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#else
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#endif
namespace MapControl

View file

@ -5,15 +5,14 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using Windows.Foundation;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#else
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#endif
namespace MapControl

View file

@ -3,10 +3,10 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if WINUI
using WindowsUI = Microsoft.UI;
#else
#if UWP
using WindowsUI = Windows.UI;
#else
using WindowsUI = Microsoft.UI;
#endif
namespace MapControl

View file

@ -4,12 +4,12 @@
using System;
using System.Threading.Tasks;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media.Animation;
#else
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Animation;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media.Animation;
#endif
namespace MapControl

View file

@ -3,20 +3,20 @@
// Licensed under the Microsoft Public License (Ms-PL)
using Windows.Foundation;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#else
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Markup;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes;
#endif
namespace MapControl

View file

@ -2,14 +2,14 @@
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media.Animation;
using Microsoft.UI.Xaml.Media.Imaging;
#else
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Media.Imaging;
#else
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media.Animation;
using Microsoft.UI.Xaml.Media.Imaging;
#endif
namespace MapControl

View file

@ -8,7 +8,7 @@ using GeoAPI.Geometries;
using ProjNet.CoordinateSystems;
using ProjNet.CoordinateSystems.Transformations;
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -4,7 +4,7 @@
using ProjNet.CoordinateSystems;
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -3,7 +3,7 @@
// Licensed under the Microsoft Public License (Ms-PL)
using System;
#if !WINUI && !UWP
#if WPF
using System.Windows;
#endif

View file

@ -13,7 +13,7 @@
<DelaySign>false</DelaySign>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageId>XAML.MapControl.MapProjections</PackageId>
<DefineConstants></DefineConstants>
<DefineConstants>WPF</DefineConstants>
</PropertyGroup>
<ItemGroup>

View file

@ -6,23 +6,23 @@ using System;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Markup;
#if WPF
using System.Windows;
using System.Windows.Markup;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Markup;
#else
using System.Windows;
using System.Windows.Markup;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Markup;
#endif
namespace MapControl.UiTools
{
#if WINUI || UWP
[ContentProperty(Name = nameof(Layer))]
#else
#if WPF
[ContentProperty(nameof(Layer))]
#else
[ContentProperty(Name = nameof(Layer))]
#endif
public class MapLayerItem
{
@ -33,10 +33,10 @@ namespace MapControl.UiTools
public UIElement GetLayer() => Layer ?? (Layer = LayerFactory?.Invoke());
}
#if WINUI || UWP
[ContentProperty(Name = nameof(MapLayers))]
#else
#if WPF
[ContentProperty(nameof(MapLayers))]
#else
[ContentProperty(Name = nameof(MapLayers))]
#endif
public class MapLayersMenuButton : MenuButton
{

View file

@ -5,23 +5,23 @@
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
#if WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Markup;
#if WPF
using System.Windows;
using System.Windows.Markup;
#elif UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Markup;
#else
using System.Windows;
using System.Windows.Markup;
#elif WINUI
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Markup;
#endif
namespace MapControl.UiTools
{
#if WINUI || UWP
[ContentProperty(Name = nameof(Projection))]
#else
#if WPF
[ContentProperty(nameof(Projection))]
#else
[ContentProperty(Name = nameof(Projection))]
#endif
public class MapProjectionItem
{
@ -29,10 +29,10 @@ namespace MapControl.UiTools
public string Projection { get; set; }
}
#if WINUI || UWP
[ContentProperty(Name = nameof(MapProjections))]
#else
#if WPF
[ContentProperty(nameof(MapProjections))]
#else
[ContentProperty(Name = nameof(MapProjections))]
#endif
public class MapProjectionsMenuButton : MenuButton
{

View file

@ -11,7 +11,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\MapControl.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<DefineConstants></DefineConstants>
<DefineConstants>WPF</DefineConstants>
</PropertyGroup>
<ItemGroup>

View file

@ -28,7 +28,7 @@ namespace ProjectionDemo
new WmsImageLayer
{
ServiceUri = new Uri("http://ows.terrestris.de/osm/service"),
Layers = "OSM-WMS"
WmsLayers = "OSM-WMS"
});
viewModel.Layers.Add(
@ -36,7 +36,7 @@ namespace ProjectionDemo
new WmsImageLayer
{
ServiceUri = new Uri("https://sgx.geodatenzentrum.de/wms_topplus_open"),
Layers = "web"
WmsLayers = "web"
});
viewModel.Layers.Add(
@ -44,7 +44,7 @@ namespace ProjectionDemo
new WmsImageLayer
{
ServiceUri = new Uri("https://geoportal.wiesbaden.de/cgi-bin/mapserv.fcgi?map=d:/openwimap/umn/map/orthophoto/orthophotos.map"),
Layers = "orthophoto2017"
WmsLayers = "orthophoto2017"
});
viewModel.CurrentProjection = viewModel.Projections[0];