From cf0f4645d437e615ba59af8ed6c6b2ddc3880dda Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Sun, 14 Sep 2025 21:02:21 +0200 Subject: [PATCH] .NET 9, including UWP --- .editorconfig | 34 -- Caches/FileDbCache/FileDbCache.csproj | 6 +- Caches/SQLiteCache/SQLiteCache.csproj | 6 +- Directory.Build.props | 2 +- MBTiles/Avalonia/MBTiles.Avalonia.csproj | 4 +- MBTiles/UWP/MBTiles.UWP.csproj | 109 ++---- MBTiles/UWP/Properties/AssemblyInfo.cs | 13 - MBTiles/UWP/Properties/MBTiles.UWP.rd.xml | 5 - MBTiles/WinUI/MBTiles.WinUI.csproj | 5 +- MapControl.sln | 35 +- .../Avalonia/MapControl.Avalonia.csproj | 8 +- MapControl/Shared/GeoImage.cs | 51 ++- MapControl/Shared/GroundOverlay.cs | 42 +-- MapControl/Shared/ImageFileCache.cs | 36 +- MapControl/Shared/ImageLoader.cs | 36 +- MapControl/Shared/TileImageLoader.cs | 2 +- MapControl/Shared/WmsImageLayer.cs | 9 +- MapControl/Shared/WmtsCapabilities.cs | 25 +- MapControl/Shared/WmtsTileLayer.cs | 2 +- MapControl/Shared/WmtsTileSource.cs | 2 +- MapControl/UWP/MapControl.UWP.csproj | 351 ++---------------- MapControl/UWP/Properties/AssemblyInfo.cs | 13 - .../UWP/Properties/MapControl.UWP.rd.xml | 5 - MapControl/WPF/ImageLoader.WPF.cs | 7 +- MapControl/WPF/MapControl.WPF.csproj | 5 +- MapControl/WPF/MapPolypoint.WPF.cs | 30 +- MapControl/WinUI/GeoImage.WinUI.cs | 87 +++-- MapControl/WinUI/ImageLoader.WinUI.cs | 25 +- MapControl/WinUI/MapControl.WinUI.csproj | 10 +- MapControlExtended.sln | 65 ++-- .../Avalonia/MapProjections.Avalonia.csproj | 4 +- MapProjections/UWP/MapProjections.UWP.csproj | 130 ++----- MapProjections/UWP/Properties/AssemblyInfo.cs | 13 - .../UWP/Properties/MapProjections.UWP.rd.xml | 33 -- .../WinUI/MapProjections.WinUI.csproj | 5 +- .../Avalonia/MapUiTools.Avalonia.csproj | 4 +- MapUiTools/UWP/MapUiTools.UWP.csproj | 115 ++---- MapUiTools/UWP/Properties/AssemblyInfo.cs | 13 - .../UWP/Properties/MapUiTools.UWP.rd.xml | 5 - MapUiTools/WinUI/MapUiTools.WinUI.csproj | 5 +- SampleApps/AvaloniaApp/AvaloniaApp.csproj | 12 +- SampleApps/UniversalApp/App.xaml | 3 +- SampleApps/UniversalApp/App.xaml.cs | 35 +- SampleApps/UniversalApp/MainPage.xaml | 5 +- SampleApps/UniversalApp/Package.appxmanifest | 39 +- .../UniversalApp/Properties/AssemblyInfo.cs | 13 - .../UniversalApp/Properties/Default.rd.xml | 5 - .../PublishProfiles/win-arm64.pubxml | 13 + .../Properties/PublishProfiles/win-x64.pubxml | 13 + .../Properties/PublishProfiles/win-x86.pubxml | 13 + .../Properties/launchSettings.json | 7 + SampleApps/UniversalApp/UniversalApp.csproj | 160 ++------ .../UniversalApp_TemporaryKey.pfx | Bin 2512 -> 0 bytes SampleApps/WinUiApp/Package.appxmanifest | 2 +- SampleApps/WinUiApp/WinUiApp.csproj | 11 +- .../WpfApplication/WpfApplication.csproj | 2 +- 56 files changed, 484 insertions(+), 1206 deletions(-) delete mode 100644 .editorconfig delete mode 100644 MBTiles/UWP/Properties/AssemblyInfo.cs delete mode 100644 MBTiles/UWP/Properties/MBTiles.UWP.rd.xml delete mode 100644 MapControl/UWP/Properties/AssemblyInfo.cs delete mode 100644 MapControl/UWP/Properties/MapControl.UWP.rd.xml delete mode 100644 MapProjections/UWP/Properties/AssemblyInfo.cs delete mode 100644 MapProjections/UWP/Properties/MapProjections.UWP.rd.xml delete mode 100644 MapUiTools/UWP/Properties/AssemblyInfo.cs delete mode 100644 MapUiTools/UWP/Properties/MapUiTools.UWP.rd.xml delete mode 100644 SampleApps/UniversalApp/Properties/AssemblyInfo.cs delete mode 100644 SampleApps/UniversalApp/Properties/Default.rd.xml create mode 100644 SampleApps/UniversalApp/Properties/PublishProfiles/win-arm64.pubxml create mode 100644 SampleApps/UniversalApp/Properties/PublishProfiles/win-x64.pubxml create mode 100644 SampleApps/UniversalApp/Properties/PublishProfiles/win-x86.pubxml create mode 100644 SampleApps/UniversalApp/Properties/launchSettings.json delete mode 100644 SampleApps/UniversalApp/UniversalApp_TemporaryKey.pfx diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index a67f5607..00000000 --- a/.editorconfig +++ /dev/null @@ -1,34 +0,0 @@ -[*.cs] - -# CA1835: Prefer the memory-based overloads of ReadAsync/WriteAsync methods in stream-based classes -dotnet_diagnostic.CA1835.severity = silent - -# CA1868: Unnecessary call to 'Contains' for sets -dotnet_diagnostic.CA1868.severity = silent - -# CsWinRT1028: Class is not marked partial -dotnet_diagnostic.CsWinRT1028.severity = silent - -# CsWinRT1030: Project does not enable unsafe blocks -dotnet_diagnostic.CsWinRT1030.severity = silent - -# IDE0063: Use simple 'using' statement -dotnet_diagnostic.IDE0063.severity = silent - -# IDE0074: Use compound assignment -dotnet_diagnostic.IDE0074.severity = silent - -# IDE0090: Simplify 'new' expression -dotnet_diagnostic.IDE0090.severity = silent - -# IDE0290: Use primary constructor -dotnet_diagnostic.IDE0290.severity = silent - -# IDE030X: Use collection expression -dotnet_diagnostic.IDE0300.severity = silent -dotnet_diagnostic.IDE0301.severity = silent -dotnet_diagnostic.IDE0302.severity = silent -dotnet_diagnostic.IDE0303.severity = silent -dotnet_diagnostic.IDE0304.severity = silent -dotnet_diagnostic.IDE0305.severity = silent -dotnet_diagnostic.IDE0306.severity = silent diff --git a/Caches/FileDbCache/FileDbCache.csproj b/Caches/FileDbCache/FileDbCache.csproj index a3008f68..3e1ae436 100644 --- a/Caches/FileDbCache/FileDbCache.csproj +++ b/Caches/FileDbCache/FileDbCache.csproj @@ -11,8 +11,8 @@ - - - + + + diff --git a/Caches/SQLiteCache/SQLiteCache.csproj b/Caches/SQLiteCache/SQLiteCache.csproj index 5d2e022d..47fa11a3 100644 --- a/Caches/SQLiteCache/SQLiteCache.csproj +++ b/Caches/SQLiteCache/SQLiteCache.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/Directory.Build.props b/Directory.Build.props index fa38f1c9..2cd1cee4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ XAML Map Control Clemens Fischer Copyright © 2025 Clemens Fischer - 13.6.0 + 14.0.0 $(Version) ..\..\MapControl.snk true diff --git a/MBTiles/Avalonia/MBTiles.Avalonia.csproj b/MBTiles/Avalonia/MBTiles.Avalonia.csproj index 0f0025f4..a601c264 100644 --- a/MBTiles/Avalonia/MBTiles.Avalonia.csproj +++ b/MBTiles/Avalonia/MBTiles.Avalonia.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 AVALONIA MapControl.MBTiles XAML Map Control MBTiles Library for Avalonia UI @@ -19,7 +19,7 @@ - + diff --git a/MBTiles/UWP/MBTiles.UWP.csproj b/MBTiles/UWP/MBTiles.UWP.csproj index a32e7c2d..1a2d56f1 100644 --- a/MBTiles/UWP/MBTiles.UWP.csproj +++ b/MBTiles/UWP/MBTiles.UWP.csproj @@ -1,81 +1,28 @@ - - - - - Debug - AnyCPU - {DCC111E9-EC8B-492A-A09D-DF390D83AE8D} - Library - Properties - MapControl.MBTiles - MBTiles.UWP - en-US - UAP - 10.0.26100.0 - 10.0.17763.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;UWP - prompt - 4 - - - AnyCPU - none - true - bin\Release\ - UWP - prompt - 4 - - - PackageReference - - - - MBTileLayer.cs - - - MBTileSource.cs - - - - - - - 6.2.14 - - - 1.0.119 - - - - - MapControl.snk - - - - - {9545f73c-9c35-4cf6-baae-19a0baebd344} - MapControl.UWP - - - - 14.0 - - - true - - - ..\..\MapControl.snk - - - \ No newline at end of file + + + net9.0-windows10.0.26100.0 + 10.0.17763.0 + true + true + en-US + UWP + MapControl.MBTiles + XAML Map Control MBTiles Library for UWP + $(GeneratePackage) + XAML.MapControl.MBTiles.UWP + $(AssemblyTitle) + MBTiles library for XAML Map Control + + + + + + + + + + + + + + diff --git a/MBTiles/UWP/Properties/AssemblyInfo.cs b/MBTiles/UWP/Properties/AssemblyInfo.cs deleted file mode 100644 index 45303dae..00000000 --- a/MBTiles/UWP/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("XAML Map Control MBTiles Library for UWP")] -[assembly: AssemblyProduct("XAML Map Control")] -[assembly: AssemblyCompany("Clemens Fischer")] -[assembly: AssemblyCopyright("Copyright © 2024 Clemens Fischer")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("13.0.0")] -[assembly: AssemblyFileVersion("13.0.0")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] diff --git a/MBTiles/UWP/Properties/MBTiles.UWP.rd.xml b/MBTiles/UWP/Properties/MBTiles.UWP.rd.xml deleted file mode 100644 index 8e1f888d..00000000 --- a/MBTiles/UWP/Properties/MBTiles.UWP.rd.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/MBTiles/WinUI/MBTiles.WinUI.csproj b/MBTiles/WinUI/MBTiles.WinUI.csproj index 1c0bec25..ef9027e1 100644 --- a/MBTiles/WinUI/MBTiles.WinUI.csproj +++ b/MBTiles/WinUI/MBTiles.WinUI.csproj @@ -1,7 +1,6 @@  - net8.0-windows10.0.17763.0 - win-x86;win-x64;win-arm64 + net9.0-windows10.0.17763.0 true WINUI MapControl.MBTiles @@ -21,7 +20,7 @@ - + diff --git a/MapControl.sln b/MapControl.sln index 1249f36c..3f423168 100644 --- a/MapControl.sln +++ b/MapControl.sln @@ -5,19 +5,11 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MapControl", "MapControl", "{52AECE49-F314-4F76-98F2-FA800F07824B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleApps", "SampleApps", "{8F2103C2-78AF-4810-8FB9-67572F50C8FC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalApp", "SampleApps\UniversalApp\UniversalApp.csproj", "{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.WPF", "MapControl\WPF\MapControl.WPF.csproj", "{62F1726B-3144-49F4-8BCC-94160A3B2186}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfApplication", "SampleApps\WpfApplication\WpfApplication.csproj", "{CA60DFDB-0BE1-40F6-B575-CDC797A40E2E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.WinUI", "MapControl\WinUI\MapControl.WinUI.csproj", "{92894476-02E1-47CB-936E-4154023456F0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUiApp", "SampleApps\WinUiApp\WinUiApp.csproj", "{579B29D7-91CA-44F3-A96D-5D9BC957BADA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MapUiTools", "MapUiTools", "{ABFA5526-FCE4-47C9-94F4-84D5F59EECA8}" EndProject @@ -25,11 +17,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.WPF", "MapUiTool EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.WinUI", "MapUiTools\WinUI\MapUiTools.WinUI.csproj", "{A877A741-9FF5-453D-89C8-3BE7A94D74C1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapUiTools.UWP", "MapUiTools\UWP\MapUiTools.UWP.csproj", "{DFFE8E49-AA07-457E-A459-99326B44F828}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.UWP", "MapUiTools\UWP\MapUiTools.UWP.csproj", "{DFFE8E49-AA07-457E-A459-99326B44F828}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleApps", "SampleApps", "{8F2103C2-78AF-4810-8FB9-67572F50C8FC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfApplication", "SampleApps\WpfApplication\WpfApplication.csproj", "{CA60DFDB-0BE1-40F6-B575-CDC797A40E2E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUiApp", "SampleApps\WinUiApp\WinUiApp.csproj", "{579B29D7-91CA-44F3-A96D-5D9BC957BADA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UniversalApp", "SampleApps\UniversalApp\UniversalApp.csproj", "{D90514BC-38EC-7FB4-BF26-2FC775815D46}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2F7354B4-786D-4113-866C-E731276C6777}" ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig Directory.Build.props = Directory.Build.props EndProjectSection EndProject @@ -39,12 +38,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Debug|Any CPU.ActiveCfg = Debug|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Debug|Any CPU.Build.0 = Debug|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Debug|Any CPU.Deploy.0 = Debug|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|Any CPU.ActiveCfg = Release|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|Any CPU.Build.0 = Release|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|Any CPU.Deploy.0 = Release|x64 {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Debug|Any CPU.Build.0 = Debug|Any CPU {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -79,12 +72,17 @@ Global {DFFE8E49-AA07-457E-A459-99326B44F828}.Debug|Any CPU.Build.0 = Debug|Any CPU {DFFE8E49-AA07-457E-A459-99326B44F828}.Release|Any CPU.ActiveCfg = Release|Any CPU {DFFE8E49-AA07-457E-A459-99326B44F828}.Release|Any CPU.Build.0 = Release|Any CPU + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Debug|Any CPU.ActiveCfg = Debug|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Debug|Any CPU.Build.0 = Debug|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Debug|Any CPU.Deploy.0 = Debug|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Release|Any CPU.ActiveCfg = Release|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Release|Any CPU.Build.0 = Release|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Release|Any CPU.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC} {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344} = {52AECE49-F314-4F76-98F2-FA800F07824B} {62F1726B-3144-49F4-8BCC-94160A3B2186} = {52AECE49-F314-4F76-98F2-FA800F07824B} {CA60DFDB-0BE1-40F6-B575-CDC797A40E2E} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC} @@ -93,6 +91,7 @@ Global {9B2886B0-D2A8-479B-B52E-1C7B63CAB97E} = {ABFA5526-FCE4-47C9-94F4-84D5F59EECA8} {A877A741-9FF5-453D-89C8-3BE7A94D74C1} = {ABFA5526-FCE4-47C9-94F4-84D5F59EECA8} {DFFE8E49-AA07-457E-A459-99326B44F828} = {ABFA5526-FCE4-47C9-94F4-84D5F59EECA8} + {D90514BC-38EC-7FB4-BF26-2FC775815D46} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {458346DD-B23F-4FDC-8F9D-A10F1882A4DB} diff --git a/MapControl/Avalonia/MapControl.Avalonia.csproj b/MapControl/Avalonia/MapControl.Avalonia.csproj index 6c508d64..0ab44b11 100644 --- a/MapControl/Avalonia/MapControl.Avalonia.csproj +++ b/MapControl/Avalonia/MapControl.Avalonia.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 true AVALONIA MapControl @@ -16,8 +16,8 @@ - - - + + + diff --git a/MapControl/Shared/GeoImage.cs b/MapControl/Shared/GeoImage.cs index c6ce19e8..80e4f76c 100644 --- a/MapControl/Shared/GeoImage.cs +++ b/MapControl/Shared/GeoImage.cs @@ -63,7 +63,7 @@ namespace MapControl private static string QueryString(ushort tag) => $"/ifd/{{ushort={tag}}}"; private static ILogger logger; - private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger(nameof(GeoImage))); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); public static readonly DependencyProperty SourcePathProperty = DependencyPropertyHelper.RegisterAttached("SourcePath", typeof(GeoImage), null, @@ -158,33 +158,32 @@ namespace MapControl private static async Task ReadWorldFileMatrix(string worldFilePath) { - using (var fileStream = File.OpenRead(worldFilePath)) - using (var streamReader = new StreamReader(fileStream)) + using var fileStream = File.OpenRead(worldFilePath); + using var streamReader = new StreamReader(fileStream); + + var parameters = new double[6]; + var index = 0; + string line; + + while (index < 6 && + (line = await streamReader.ReadLineAsync()) != null && + double.TryParse(line, NumberStyles.Float, CultureInfo.InvariantCulture, out double parameter)) { - var parameters = new double[6]; - var index = 0; - string line; - - while (index < 6 && - (line = await streamReader.ReadLineAsync()) != null && - double.TryParse(line, NumberStyles.Float, CultureInfo.InvariantCulture, out double parameter)) - { - parameters[index++] = parameter; - } - - if (index != 6) - { - throw new ArgumentException($"Insufficient number of parameters in world file {worldFilePath}."); - } - - return new Matrix( - parameters[0], // line 1: A or M11 - parameters[1], // line 2: D or M12 - parameters[2], // line 3: B or M21 - parameters[3], // line 4: E or M22 - parameters[4], // line 5: C or OffsetX - parameters[5]); // line 6: F or OffsetY + parameters[index++] = parameter; } + + if (index != 6) + { + throw new ArgumentException($"Insufficient number of parameters in world file {worldFilePath}."); + } + + return new Matrix( + parameters[0], // line 1: A or M11 + parameters[1], // line 2: D or M12 + parameters[2], // line 3: B or M21 + parameters[3], // line 4: E or M22 + parameters[4], // line 5: C or OffsetX + parameters[5]); // line 6: F or OffsetY } private static MapProjection GetProjection(short[] geoKeyDirectory) diff --git a/MapControl/Shared/GroundOverlay.cs b/MapControl/Shared/GroundOverlay.cs index 0c72ea59..a1c41f80 100644 --- a/MapControl/Shared/GroundOverlay.cs +++ b/MapControl/Shared/GroundOverlay.cs @@ -52,23 +52,22 @@ namespace MapControl if (entry != null) { - using (var memoryStream = new MemoryStream((int)entry.Length)) + using var memoryStream = new MemoryStream((int)entry.Length); + + using (var zipStream = entry.Open()) { - using (var zipStream = entry.Open()) - { - zipStream.CopyTo(memoryStream); // can't use CopyToAsync with ZipArchive - } - - memoryStream.Seek(0, SeekOrigin.Begin); - - Image.Source = await ImageLoader.LoadImageAsync(memoryStream); + zipStream.CopyTo(memoryStream); // can't use CopyToAsync with ZipArchive } + + memoryStream.Seek(0, SeekOrigin.Begin); + + Image.Source = await ImageLoader.LoadImageAsync(memoryStream); } } } private static ILogger logger; - private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger()); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); public static readonly DependencyProperty SourcePathProperty = DependencyPropertyHelper.Register(nameof(SourcePath), null, @@ -127,20 +126,19 @@ namespace MapControl private static async Task> LoadImageOverlaysFromArchive(string archiveFilePath) { - using (var archive = ZipFile.OpenRead(archiveFilePath)) + using var archive = ZipFile.OpenRead(archiveFilePath); + + var docEntry = archive.GetEntry("doc.kml") ?? + archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml")) ?? + throw new ArgumentException($"No KML entry found in {archiveFilePath}."); + XDocument document; + + using (var docStream = docEntry.Open()) { - var docEntry = archive.GetEntry("doc.kml") ?? - archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml")) ?? - throw new ArgumentException($"No KML entry found in {archiveFilePath}."); - XDocument document; - - using (var docStream = docEntry.Open()) - { - document = await LoadXDocument(docStream); - } - - return await LoadImageOverlays(document, imageOverlay => imageOverlay.LoadImage(archive)); + document = await LoadXDocument(docStream); } + + return await LoadImageOverlays(document, imageOverlay => imageOverlay.LoadImage(archive)); } private static async Task> LoadImageOverlaysFromFile(string docFilePath) diff --git a/MapControl/Shared/ImageFileCache.cs b/MapControl/Shared/ImageFileCache.cs index 6317cac1..e71cd217 100644 --- a/MapControl/Shared/ImageFileCache.cs +++ b/MapControl/Shared/ImageFileCache.cs @@ -326,34 +326,30 @@ namespace MapControl.Caching private static byte[] ReadAllBytes(FileInfo file) { - using (var stream = file.OpenRead()) + using var stream = file.OpenRead(); + var buffer = new byte[stream.Length]; + var offset = 0; + + while (offset < buffer.Length) { - var buffer = new byte[stream.Length]; - var offset = 0; - - while (offset < buffer.Length) - { - offset += stream.Read(buffer, offset, buffer.Length - offset); - } - - return buffer; + offset += stream.Read(buffer, offset, buffer.Length - offset); } + + return buffer; } private static async Task ReadAllBytes(FileInfo file, CancellationToken token) { - using (var stream = file.OpenRead()) + using var stream = file.OpenRead(); + var buffer = new byte[stream.Length]; + var offset = 0; + + while (offset < buffer.Length) { - var buffer = new byte[stream.Length]; - var offset = 0; - - while (offset < buffer.Length) - { - offset += await stream.ReadAsync(buffer, offset, buffer.Length - offset, token).ConfigureAwait(false); - } - - return buffer; + offset += await stream.ReadAsync(buffer, offset, buffer.Length - offset, token).ConfigureAwait(false); } + + return buffer; } private static void SetExpiration(FileInfo file, DistributedCacheEntryOptions options) diff --git a/MapControl/Shared/ImageLoader.cs b/MapControl/Shared/ImageLoader.cs index de54adb1..e93efaf5 100644 --- a/MapControl/Shared/ImageLoader.cs +++ b/MapControl/Shared/ImageLoader.cs @@ -16,7 +16,7 @@ namespace MapControl public static partial class ImageLoader { private static ILogger logger; - private static ILogger Logger => logger ?? (logger = LoggerFactory?.CreateLogger(typeof(ImageLoader))); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); public static ILoggerFactory LoggerFactory { get; set; } @@ -33,10 +33,9 @@ namespace MapControl public static async Task LoadImageAsync(byte[] buffer) { - using (var stream = new MemoryStream(buffer)) - { - return await LoadImageAsync(stream); - } + using var stream = new MemoryStream(buffer); + + return await LoadImageAsync(stream); } public static async Task LoadImageAsync(Uri uri, IProgress progress = null) @@ -84,25 +83,24 @@ namespace MapControl { var completionOptions = progress != null ? HttpCompletionOption.ResponseHeadersRead : HttpCompletionOption.ResponseContentRead; - using (var responseMessage = await HttpClient.GetAsync(uri, completionOptions).ConfigureAwait(false)) - { - if (responseMessage.IsSuccessStatusCode) - { - if (progress != null && responseMessage.Content.Headers.ContentLength.HasValue) - { - buffer = await ReadAsByteArray(responseMessage.Content, progress).ConfigureAwait(false); - } - else - { - buffer = await responseMessage.Content.ReadAsByteArrayAsync().ConfigureAwait(false); - } + using var responseMessage = await HttpClient.GetAsync(uri, completionOptions).ConfigureAwait(false); - maxAge = responseMessage.Headers.CacheControl?.MaxAge; + if (responseMessage.IsSuccessStatusCode) + { + if (progress != null && responseMessage.Content.Headers.ContentLength.HasValue) + { + buffer = await ReadAsByteArray(responseMessage.Content, progress).ConfigureAwait(false); } else { - Logger?.LogWarning("{status} ({reason}) from {uri}", (int)responseMessage.StatusCode, responseMessage.ReasonPhrase, uri); + buffer = await responseMessage.Content.ReadAsByteArrayAsync().ConfigureAwait(false); } + + maxAge = responseMessage.Headers.CacheControl?.MaxAge; + } + else + { + Logger?.LogWarning("{status} ({reason}) from {uri}", (int)responseMessage.StatusCode, responseMessage.ReasonPhrase, uri); } } catch (TaskCanceledException) diff --git a/MapControl/Shared/TileImageLoader.cs b/MapControl/Shared/TileImageLoader.cs index 24622484..62e5a359 100644 --- a/MapControl/Shared/TileImageLoader.cs +++ b/MapControl/Shared/TileImageLoader.cs @@ -23,7 +23,7 @@ namespace MapControl public class TileImageLoader : ITileImageLoader { private static ILogger logger; - private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger()); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); /// /// Default folder path where a persistent cache implementation may save data, i.e. "C:\ProgramData\MapControl\TileCache". diff --git a/MapControl/Shared/WmsImageLayer.cs b/MapControl/Shared/WmsImageLayer.cs index fe58de6c..136e4b0e 100644 --- a/MapControl/Shared/WmsImageLayer.cs +++ b/MapControl/Shared/WmsImageLayer.cs @@ -26,7 +26,7 @@ namespace MapControl public class WmsImageLayer : MapImageLayer { private static ILogger logger; - private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger()); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); public static readonly DependencyProperty ServiceUriProperty = DependencyPropertyHelper.Register(nameof(ServiceUri), null, @@ -112,10 +112,9 @@ namespace MapControl { try { - using (var stream = await ImageLoader.HttpClient.GetStreamAsync(uri)) - { - element = XDocument.Load(stream).Root; - } + using var stream = await ImageLoader.HttpClient.GetStreamAsync(uri); + + element = XDocument.Load(stream).Root; } catch (Exception ex) { diff --git a/MapControl/Shared/WmtsCapabilities.cs b/MapControl/Shared/WmtsCapabilities.cs index c6bb847b..9a9f5598 100644 --- a/MapControl/Shared/WmtsCapabilities.cs +++ b/MapControl/Shared/WmtsCapabilities.cs @@ -31,10 +31,9 @@ namespace MapControl if (capabilitiesUri.IsAbsoluteUri && (capabilitiesUri.Scheme == "http" || capabilitiesUri.Scheme == "https")) { - using (var stream = await ImageLoader.HttpClient.GetStreamAsync(capabilitiesUri)) - { - capabilities = ReadCapabilities(XDocument.Load(stream).Root, layer, capabilitiesUri.ToString()); - } + using var stream = await ImageLoader.HttpClient.GetStreamAsync(capabilitiesUri); + + capabilities = ReadCapabilities(XDocument.Load(stream).Root, layer, capabilitiesUri.ToString()); } else { @@ -46,12 +45,8 @@ namespace MapControl public static WmtsCapabilities ReadCapabilities(XElement capabilitiesElement, string layer, string capabilitiesUrl) { - var contentsElement = capabilitiesElement.Element(wmts + "Contents"); - - if (contentsElement == null) - { - throw new ArgumentException("Contents element not found."); - } + var contentsElement = capabilitiesElement.Element(wmts + "Contents") + ?? throw new ArgumentException("Contents element not found."); XElement layerElement; @@ -102,12 +97,8 @@ namespace MapControl { var tileMatrixSetElement = contentsElement .Elements(wmts + "TileMatrixSet") - .FirstOrDefault(s => s.Element(ows + "Identifier")?.Value == tileMatrixSetId); - - if (tileMatrixSetElement == null) - { - throw new ArgumentException($"Linked TileMatrixSet element not found in Layer \"{layer}\"."); - } + .FirstOrDefault(s => s.Element(ows + "Identifier")?.Value == tileMatrixSetId) + ?? throw new ArgumentException($"Linked TileMatrixSet element not found in Layer \"{layer}\"."); tileMatrixSets.Add(ReadTileMatrixSet(tileMatrixSetElement)); } @@ -134,7 +125,7 @@ namespace MapControl .ToLookup(r => r.Attribute("format").Value, r => r.Attribute("template").Value); - if (resourceUrls.Any()) + if (resourceUrls.Count != 0) { var urlTemplates = resourceUrls.Contains(formatPng) ? resourceUrls[formatPng] : resourceUrls.Contains(formatJpg) ? resourceUrls[formatJpg] diff --git a/MapControl/Shared/WmtsTileLayer.cs b/MapControl/Shared/WmtsTileLayer.cs index 8e6170dc..2ae12320 100644 --- a/MapControl/Shared/WmtsTileLayer.cs +++ b/MapControl/Shared/WmtsTileLayer.cs @@ -23,7 +23,7 @@ namespace MapControl public class WmtsTileLayer : MapTileLayerBase { private static ILogger logger; - private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger()); + private static ILogger Logger => logger ??= ImageLoader.LoggerFactory?.CreateLogger(); public static readonly DependencyProperty CapabilitiesUriProperty = DependencyPropertyHelper.Register(nameof(CapabilitiesUri), null, diff --git a/MapControl/Shared/WmtsTileSource.cs b/MapControl/Shared/WmtsTileSource.cs index bcaaeb3f..ff460a09 100644 --- a/MapControl/Shared/WmtsTileSource.cs +++ b/MapControl/Shared/WmtsTileSource.cs @@ -6,7 +6,7 @@ namespace MapControl { public WmtsTileMatrixSet TileMatrixSet { get; set; } - public override Uri GetUri(int column, int row, int zoomLevel) + public override Uri GetUri(int zoomLevel, int column, int row) { Uri uri = null; diff --git a/MapControl/UWP/MapControl.UWP.csproj b/MapControl/UWP/MapControl.UWP.csproj index 7b5e929e..19aa6099 100644 --- a/MapControl/UWP/MapControl.UWP.csproj +++ b/MapControl/UWP/MapControl.UWP.csproj @@ -1,320 +1,31 @@ - - - - - Debug - AnyCPU - {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344} - Library - Properties - MapControl - MapControl.UWP - en-US - UAP - 10.0.26100.0 - 10.0.17763.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;UWP - prompt - 4 - - - AnyCPU - none - true - bin\Release\ - UWP - prompt - 4 - true - - - PackageReference - - - - AutoEquirectangularProjection.cs - - - AzimuthalEquidistantProjection.cs - - - AzimuthalProjection.cs - - - BoundingBox.cs - - - BoundingBoxTileSource.cs - - - CenteredBoundingBox.cs - - - DispatcherTimerExtensions.cs - - - EquirectangularProjection.cs - - - Etrs89UtmProjection.cs - - - FilePath.cs - - - GeoImage.cs - - - GnomonicProjection.cs - - - GroundOverlay.cs - - - ImageFileCache.cs - - - ImageLoader.cs - - - LatLonBox.cs - - - Location.cs - - - LocationCollection.cs - - - Map.cs - - - MapBase.cs - - - MapBase.MapLayer.cs - - - MapBorderPanel.cs - - - MapGraticule.cs - - - MapImageLayer.cs - - - MapItem.cs - - - MapItemsControl.cs - - - MapMultiPolygon.cs - - - MapPanel.cs - - - MapPath.cs - - - MapPolygon.cs - - - MapPolyline.cs - - - MapProjection.cs - - - MapProjectionFactory.cs - - - MapScale.cs - - - MapTileLayer.cs - - - MapTileLayerBase.cs - - - Nad27UtmProjection.cs - - - Nad83UtmProjection.cs - - - OrthographicProjection.cs - - - PolarStereographicProjection.cs - - - PolygonCollection.cs - - - PushpinBorder.cs - - - StereographicProjection.cs - - - Tile.cs - - - TileCollection.cs - - - TileImageLoader.cs - - - TileMatrix.cs - - - TileSource.cs - - - TransverseMercatorProjection.cs - - - TypeConverters.cs - - - ViewportChangedEventArgs.cs - - - ViewTransform.cs - - - WebMercatorProjection.cs - - - Wgs84UtmProjection.cs - - - WmsImageLayer.cs - - - WmtsCapabilities.cs - - - WmtsTileLayer.cs - - - WmtsTileMatrix.cs - - - WmtsTileMatrixLayer.cs - - - WmtsTileMatrixSet.cs - - - WmtsTileSource.cs - - - WorldMercatorProjection.cs - - - DependencyPropertyHelper.WinUI.cs - - - GeoImage.WinUI.cs - - - ImageLoader.WinUI.cs - - - Map.WinUI.cs - - - MapBase.WinUI.cs - - - MapContentControl.WinUI.cs - - - MapGraticule.WinUI.cs - - - MapImageLayer.WinUI.cs - - - MapItem.WinUI.cs - - - MapItemsControl.WinUI.cs - - - MapPanel.WinUI.cs - - - MapPath.WinUI.cs - - - MapPolypoint.WinUI.cs - - - Matrix.WinUI.cs - - - Point.WinUI.cs - - - PushpinBorder.WinUI.cs - - - Rect.WinUI.cs - - - Tile.WinUI.cs - - - - - - - 9.0.8 - - - 9.0.8 - - - 6.2.14 - - - - - MapControl.snk - - - - - - MSBuild:Compile - Designer - - - - 14.0 - - - true - - - ..\..\MapControl.snk - - - \ No newline at end of file + + + net9.0-windows10.0.26100.0 + 10.0.17763.0 + true + true + true + en-US + UWP + MapControl + XAML Map Control Library for UWP + $(GeneratePackage) + XAML.MapControl.UWP + $(AssemblyTitle) + A set of UWP controls for rendering raster maps from different providers like OpenStreetMap and various types of map overlays + + + + + + + + + + + + + + + + diff --git a/MapControl/UWP/Properties/AssemblyInfo.cs b/MapControl/UWP/Properties/AssemblyInfo.cs deleted file mode 100644 index a0497e61..00000000 --- a/MapControl/UWP/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("XAML Map Control Library for UWP")] -[assembly: AssemblyProduct("XAML Map Control")] -[assembly: AssemblyCompany("Clemens Fischer")] -[assembly: AssemblyCopyright("Copyright © 2024 Clemens Fischer")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("13.0.0")] -[assembly: AssemblyFileVersion("13.0.0")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] diff --git a/MapControl/UWP/Properties/MapControl.UWP.rd.xml b/MapControl/UWP/Properties/MapControl.UWP.rd.xml deleted file mode 100644 index 5ab732e0..00000000 --- a/MapControl/UWP/Properties/MapControl.UWP.rd.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/MapControl/WPF/ImageLoader.WPF.cs b/MapControl/WPF/ImageLoader.WPF.cs index f28b6f8a..8483b955 100644 --- a/MapControl/WPF/ImageLoader.WPF.cs +++ b/MapControl/WPF/ImageLoader.WPF.cs @@ -34,10 +34,9 @@ namespace MapControl if (File.Exists(path)) { - using (var stream = File.OpenRead(path)) - { - image = LoadImage(stream); - } + using var stream = File.OpenRead(path); + + image = LoadImage(stream); } return image; diff --git a/MapControl/WPF/MapControl.WPF.csproj b/MapControl/WPF/MapControl.WPF.csproj index 29c15aaa..d7e23c15 100644 --- a/MapControl/WPF/MapControl.WPF.csproj +++ b/MapControl/WPF/MapControl.WPF.csproj @@ -1,6 +1,7 @@  net8.0-windows;net462 + 8.0 true WPF MapControl @@ -25,7 +26,7 @@ - - + + diff --git a/MapControl/WPF/MapPolypoint.WPF.cs b/MapControl/WPF/MapPolypoint.WPF.cs index 9af255cc..85899e19 100644 --- a/MapControl/WPF/MapPolypoint.WPF.cs +++ b/MapControl/WPF/MapPolypoint.WPF.cs @@ -54,29 +54,27 @@ namespace MapControl protected void UpdateData(IEnumerable locations, bool closed) { - using (var context = ((StreamGeometry)Data).Open()) - { - if (ParentMap != null && locations != null) - { - var longitudeOffset = GetLongitudeOffset(Location ?? locations.FirstOrDefault()); + using var context = ((StreamGeometry)Data).Open(); - AddPolylinePoints(context, locations, longitudeOffset, closed); - } + if (ParentMap != null && locations != null) + { + var longitudeOffset = GetLongitudeOffset(Location ?? locations.FirstOrDefault()); + + AddPolylinePoints(context, locations, longitudeOffset, closed); } } protected void UpdateData(IEnumerable> polygons) { - using (var context = ((StreamGeometry)Data).Open()) - { - if (ParentMap != null && polygons != null) - { - var longitudeOffset = GetLongitudeOffset(Location); + using var context = ((StreamGeometry)Data).Open(); - foreach (var locations in polygons) - { - AddPolylinePoints(context, locations, longitudeOffset, true); - } + if (ParentMap != null && polygons != null) + { + var longitudeOffset = GetLongitudeOffset(Location); + + foreach (var locations in polygons) + { + AddPolylinePoints(context, locations, longitudeOffset, true); } } } diff --git a/MapControl/WinUI/GeoImage.WinUI.cs b/MapControl/WinUI/GeoImage.WinUI.cs index 08f40c9d..b8f6364d 100644 --- a/MapControl/WinUI/GeoImage.WinUI.cs +++ b/MapControl/WinUI/GeoImage.WinUI.cs @@ -20,52 +20,51 @@ namespace MapControl var file = await StorageFile.GetFileFromPathAsync(FilePath.GetFullPath(sourcePath)); - using (var stream = await file.OpenReadAsync()) + using var stream = await file.OpenReadAsync(); + + var decoder = await BitmapDecoder.CreateAsync(stream); + + bitmap = await ImageLoader.LoadWriteableBitmapAsync(decoder); + + var geoKeyDirectoryQuery = QueryString(GeoKeyDirectoryTag); + var pixelScaleQuery = QueryString(ModelPixelScaleTag); + var tiePointQuery = QueryString(ModelTiePointTag); + var transformationQuery = QueryString(ModelTransformationTag); + var metadata = await decoder.BitmapProperties.GetPropertiesAsync( + new string[] + { + pixelScaleQuery, + tiePointQuery, + transformationQuery, + geoKeyDirectoryQuery + }); + + if (metadata.TryGetValue(pixelScaleQuery, out BitmapTypedValue pixelScaleValue) && + pixelScaleValue.Value is double[] pixelScale && + pixelScale.Length == 3 && + metadata.TryGetValue(tiePointQuery, out BitmapTypedValue tiePointValue) && + tiePointValue.Value is double[] tiePoint && + tiePoint.Length >= 6) { - var decoder = await BitmapDecoder.CreateAsync(stream); + transform = new Matrix(pixelScale[0], 0d, 0d, -pixelScale[1], tiePoint[3], tiePoint[4]); + } + else if (metadata.TryGetValue(transformationQuery, out BitmapTypedValue transformValue) && + transformValue.Value is double[] transformValues && + transformValues.Length == 16) + { + transform = new Matrix(transformValues[0], transformValues[1], + transformValues[4], transformValues[5], + transformValues[3], transformValues[7]); + } + else + { + throw new ArgumentException("No coordinate transformation found."); + } - bitmap = await ImageLoader.LoadWriteableBitmapAsync(decoder); - - var geoKeyDirectoryQuery = QueryString(GeoKeyDirectoryTag); - var pixelScaleQuery = QueryString(ModelPixelScaleTag); - var tiePointQuery = QueryString(ModelTiePointTag); - var transformationQuery = QueryString(ModelTransformationTag); - var metadata = await decoder.BitmapProperties.GetPropertiesAsync( - new string[] - { - pixelScaleQuery, - tiePointQuery, - transformationQuery, - geoKeyDirectoryQuery - }); - - if (metadata.TryGetValue(pixelScaleQuery, out BitmapTypedValue pixelScaleValue) && - pixelScaleValue.Value is double[] pixelScale && - pixelScale.Length == 3 && - metadata.TryGetValue(tiePointQuery, out BitmapTypedValue tiePointValue) && - tiePointValue.Value is double[] tiePoint && - tiePoint.Length >= 6) - { - transform = new Matrix(pixelScale[0], 0d, 0d, -pixelScale[1], tiePoint[3], tiePoint[4]); - } - else if (metadata.TryGetValue(transformationQuery, out BitmapTypedValue transformValue) && - transformValue.Value is double[] transformValues && - transformValues.Length == 16) - { - transform = new Matrix(transformValues[0], transformValues[1], - transformValues[4], transformValues[5], - transformValues[3], transformValues[7]); - } - else - { - throw new ArgumentException("No coordinate transformation found."); - } - - if (metadata.TryGetValue(geoKeyDirectoryQuery, out BitmapTypedValue geoKeyDirValue) && - geoKeyDirValue.Value is short[] geoKeyDirectory) - { - projection = GetProjection(geoKeyDirectory); - } + if (metadata.TryGetValue(geoKeyDirectoryQuery, out BitmapTypedValue geoKeyDirValue) && + geoKeyDirValue.Value is short[] geoKeyDirectory) + { + projection = GetProjection(geoKeyDirectory); } return new GeoBitmap(bitmap, transform, projection); diff --git a/MapControl/WinUI/ImageLoader.WinUI.cs b/MapControl/WinUI/ImageLoader.WinUI.cs index 0ed33215..c62ff7a9 100644 --- a/MapControl/WinUI/ImageLoader.WinUI.cs +++ b/MapControl/WinUI/ImageLoader.WinUI.cs @@ -34,10 +34,9 @@ namespace MapControl public static async Task LoadImageAsync(Stream stream) { - using (var randomAccessStream = stream.AsRandomAccessStream()) - { - return await LoadImageAsync(randomAccessStream); - } + using var randomAccessStream = stream.AsRandomAccessStream(); + + return await LoadImageAsync(randomAccessStream); } public static async Task LoadImageAsync(string path) @@ -50,10 +49,9 @@ namespace MapControl { var file = await StorageFile.GetFileFromPathAsync(path); - using (var randomAccessStream = await file.OpenReadAsync()) - { - image = await LoadImageAsync(randomAccessStream); - } + using var randomAccessStream = await file.OpenReadAsync(); + + image = await LoadImageAsync(randomAccessStream); } return image; @@ -84,13 +82,12 @@ namespace MapControl if (buffer != null) { - using (var memoryStream = new MemoryStream(buffer)) - using (var randomAccessStream = memoryStream.AsRandomAccessStream()) - { - var decoder = await BitmapDecoder.CreateAsync(randomAccessStream); + using var memoryStream = new MemoryStream(buffer); + using var randomAccessStream = memoryStream.AsRandomAccessStream(); - bitmap = await LoadWriteableBitmapAsync(decoder); - } + var decoder = await BitmapDecoder.CreateAsync(randomAccessStream); + + bitmap = await LoadWriteableBitmapAsync(decoder); } } catch (Exception ex) diff --git a/MapControl/WinUI/MapControl.WinUI.csproj b/MapControl/WinUI/MapControl.WinUI.csproj index 1ae27f33..158de74d 100644 --- a/MapControl/WinUI/MapControl.WinUI.csproj +++ b/MapControl/WinUI/MapControl.WinUI.csproj @@ -1,8 +1,8 @@  - net8.0-windows10.0.17763.0 - win-x86;win-x64;win-arm64 + net9.0-windows10.0.17763.0 true + true WINUI MapControl XAML Map Control Library for WinUI @@ -17,9 +17,9 @@ - + - - + + diff --git a/MapControlExtended.sln b/MapControlExtended.sln index d3503a3e..0984e7da 100644 --- a/MapControlExtended.sln +++ b/MapControlExtended.sln @@ -7,43 +7,41 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MapControl", "MapControl", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.WPF", "MapControl\WPF\MapControl.WPF.csproj", "{A204A102-C745-4D65-AEC8-7B96FAEDEF2D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleApps", "SampleApps", "{8F2103C2-78AF-4810-8FB9-67572F50C8FC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.WinUI", "MapControl\WinUI\MapControl.WinUI.csproj", "{ACA8E56C-0F82-4010-A83E-2DBFF5D16919}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalApp", "SampleApps\UniversalApp\UniversalApp.csproj", "{AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MBTiles", "MBTiles", "{CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MBTiles.WPF", "MBTiles\WPF\MBTiles.WPF.csproj", "{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapControl.UWP", "MapControl\UWP\MapControl.UWP.csproj", "{9545F73C-9C35-4CF6-BAAE-19A0BAEBD344}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MBTiles.UWP", "MBTiles\UWP\MBTiles.UWP.csproj", "{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.Avalonia", "MapControl\Avalonia\MapControl.Avalonia.csproj", "{0D621538-3DAD-4D3A-BB2C-220B6C580E51}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MapProjections", "MapProjections", "{7BC11E28-8D3B-4C5B-AC08-AB249CC95F6D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapProjections.WPF", "MapProjections\WPF\MapProjections.WPF.csproj", "{426C21C0-5F14-491F-BCD1-6D2993510420}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfApplication", "SampleApps\WpfApplication\WpfApplication.csproj", "{F92DA93D-75DB-4308-A5F9-6B4C3908A675}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapProjections.UWP", "MapProjections\UWP\MapProjections.UWP.csproj", "{9EE69591-5EDC-45E3-893E-2F9A4B82D538}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.WinUI", "MapControl\WinUI\MapControl.WinUI.csproj", "{ACA8E56C-0F82-4010-A83E-2DBFF5D16919}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapProjections.WinUI", "MapProjections\WinUI\MapProjections.WinUI.csproj", "{3572F71A-83FE-459D-8370-002CA28827FE}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapProjections.UWP", "MapProjections\UWP\MapProjections.UWP.csproj", "{9EE69591-5EDC-45E3-893E-2F9A4B82D538}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapProjections.Avalonia", "MapProjections\Avalonia\MapProjections.Avalonia.csproj", "{DCBE392B-A598-4EEC-8001-30D9FC88A77C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MBTiles", "MBTiles", "{CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MBTiles.WPF", "MBTiles\WPF\MBTiles.WPF.csproj", "{38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MBTiles.WinUI", "MBTiles\WinUI\MBTiles.WinUI.csproj", "{817D606F-A22D-485C-89CF-86062C8E97EF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUiApp", "SampleApps\WinUiApp\WinUiApp.csproj", "{751EF297-7CF4-4879-BA8F-42661FA68668}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MBTiles.UWP", "MBTiles\UWP\MBTiles.UWP.csproj", "{DCC111E9-EC8B-492A-A09D-DF390D83AE8D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectionDemo", "SampleApps\ProjectionDemo\ProjectionDemo.csproj", "{AC8C7BE0-9E72-434B-8BF3-FAEFAC2E859C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MBTiles.Avalonia", "MBTiles\Avalonia\MBTiles.Avalonia.csproj", "{9E247AA8-8A3F-4562-930B-925CE2879B34}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MapUiTools", "MapUiTools", "{90C681E9-12AE-4B5F-932D-7EF5D35D8436}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapUiTools.UWP", "MapUiTools\UWP\MapUiTools.UWP.csproj", "{DFFE8E49-AA07-457E-A459-99326B44F828}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.WPF", "MapUiTools\WPF\MapUiTools.WPF.csproj", "{12430DAE-DC53-4C37-95D5-B8923B5FD3D7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.UWP", "MapUiTools\UWP\MapUiTools.UWP.csproj", "{DFFE8E49-AA07-457E-A459-99326B44F828}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.WinUI", "MapUiTools\WinUI\MapUiTools.WinUI.csproj", "{C412209E-D81D-4ACB-BECD-FEEF52B93468}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.WPF", "MapUiTools\WPF\MapUiTools.WPF.csproj", "{12430DAE-DC53-4C37-95D5-B8923B5FD3D7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.Avalonia", "MapUiTools\Avalonia\MapUiTools.Avalonia.csproj", "{3D61474F-2F72-47E2-87AA-2881AB552D1A}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caches", "Caches", "{69E6CD1A-5619-4549-95FF-2FD126F1A5D2}" EndProject @@ -51,19 +49,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileDbCache", "Caches\FileD EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SQLiteCache", "Caches\SQLiteCache\SQLiteCache.csproj", "{FDD70FB5-3B6D-43DF-8C2E-04100315C8BC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapControl.Avalonia", "MapControl\Avalonia\MapControl.Avalonia.csproj", "{0D621538-3DAD-4D3A-BB2C-220B6C580E51}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleApps", "SampleApps", "{8F2103C2-78AF-4810-8FB9-67572F50C8FC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfApplication", "SampleApps\WpfApplication\WpfApplication.csproj", "{F92DA93D-75DB-4308-A5F9-6B4C3908A675}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUiApp", "SampleApps\WinUiApp\WinUiApp.csproj", "{751EF297-7CF4-4879-BA8F-42661FA68668}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UniversalApp", "SampleApps\UniversalApp\UniversalApp.csproj", "{D90514BC-38EC-7FB4-BF26-2FC775815D46}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaApp", "SampleApps\AvaloniaApp\AvaloniaApp.csproj", "{68629CA3-4599-4737-B44C-40B513DD1385}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapUiTools.Avalonia", "MapUiTools\Avalonia\MapUiTools.Avalonia.csproj", "{3D61474F-2F72-47E2-87AA-2881AB552D1A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapProjections.Avalonia", "MapProjections\Avalonia\MapProjections.Avalonia.csproj", "{DCBE392B-A598-4EEC-8001-30D9FC88A77C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MBTiles.Avalonia", "MBTiles\Avalonia\MBTiles.Avalonia.csproj", "{9E247AA8-8A3F-4562-930B-925CE2879B34}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectionDemo", "SampleApps\ProjectionDemo\ProjectionDemo.csproj", "{AC8C7BE0-9E72-434B-8BF3-FAEFAC2E859C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F6270D0A-8250-4D3A-A3E3-21B2FF18AF76}" ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig Directory.Build.props = Directory.Build.props EndProjectSection EndProject @@ -77,12 +76,6 @@ Global {A204A102-C745-4D65-AEC8-7B96FAEDEF2D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A204A102-C745-4D65-AEC8-7B96FAEDEF2D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A204A102-C745-4D65-AEC8-7B96FAEDEF2D}.Release|Any CPU.Build.0 = Release|Any CPU - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Debug|Any CPU.ActiveCfg = Debug|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Debug|Any CPU.Build.0 = Debug|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Debug|Any CPU.Deploy.0 = Debug|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|Any CPU.ActiveCfg = Release|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|Any CPU.Build.0 = Release|x64 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1}.Release|Any CPU.Deploy.0 = Release|x64 {38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Debug|Any CPU.Build.0 = Debug|Any CPU {38B18AB6-6E70-4696-8FB4-E8C8E12BF50C}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -169,13 +162,18 @@ Global {9E247AA8-8A3F-4562-930B-925CE2879B34}.Debug|Any CPU.Build.0 = Debug|Any CPU {9E247AA8-8A3F-4562-930B-925CE2879B34}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E247AA8-8A3F-4562-930B-925CE2879B34}.Release|Any CPU.Build.0 = Release|Any CPU + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Debug|Any CPU.ActiveCfg = Debug|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Debug|Any CPU.Build.0 = Debug|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Debug|Any CPU.Deploy.0 = Debug|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Release|Any CPU.ActiveCfg = Release|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Release|Any CPU.Build.0 = Release|x64 + {D90514BC-38EC-7FB4-BF26-2FC775815D46}.Release|Any CPU.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {A204A102-C745-4D65-AEC8-7B96FAEDEF2D} = {52AECE49-F314-4F76-98F2-FA800F07824B} - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC} {38B18AB6-6E70-4696-8FB4-E8C8E12BF50C} = {CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737} {9545F73C-9C35-4CF6-BAAE-19A0BAEBD344} = {52AECE49-F314-4F76-98F2-FA800F07824B} {DCC111E9-EC8B-492A-A09D-DF390D83AE8D} = {CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737} @@ -197,6 +195,7 @@ Global {3D61474F-2F72-47E2-87AA-2881AB552D1A} = {90C681E9-12AE-4B5F-932D-7EF5D35D8436} {DCBE392B-A598-4EEC-8001-30D9FC88A77C} = {7BC11E28-8D3B-4C5B-AC08-AB249CC95F6D} {9E247AA8-8A3F-4562-930B-925CE2879B34} = {CEAD0EA1-A971-4F5F-9EAE-C72F75D1F737} + {D90514BC-38EC-7FB4-BF26-2FC775815D46} = {8F2103C2-78AF-4810-8FB9-67572F50C8FC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {458346DD-B23F-4FDC-8F9D-A10F1882A4DB} diff --git a/MapProjections/Avalonia/MapProjections.Avalonia.csproj b/MapProjections/Avalonia/MapProjections.Avalonia.csproj index 861ab818..6b94bfd7 100644 --- a/MapProjections/Avalonia/MapProjections.Avalonia.csproj +++ b/MapProjections/Avalonia/MapProjections.Avalonia.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 AVALONIA MapControl.Projections XAML Map Control Projections Library for Avalonia UI @@ -19,7 +19,7 @@ - + diff --git a/MapProjections/UWP/MapProjections.UWP.csproj b/MapProjections/UWP/MapProjections.UWP.csproj index d6f2462c..2dd1ff6c 100644 --- a/MapProjections/UWP/MapProjections.UWP.csproj +++ b/MapProjections/UWP/MapProjections.UWP.csproj @@ -1,102 +1,28 @@ - - - - - Debug - AnyCPU - {9EE69591-5EDC-45E3-893E-2F9A4B82D538} - Library - Properties - MapControl.Projections - MapProjections.UWP - en-US - UAP - 10.0.26100.0 - 10.0.17763.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;UWP - prompt - 4 - - - AnyCPU - none - true - bin\Release\ - UWP - prompt - 4 - - - PackageReference - - - - Ed50UtmProjection.cs - - - Etrs89UtmProjection.cs - - - GeoApiProjection.cs - - - GeoApiProjectionFactory.cs - - - Nad27UtmProjection.cs - - - Nad83UtmProjection.cs - - - WebMercatorProjection.cs - - - Wgs84UtmProjection.cs - - - WorldMercatorProjection.cs - - - - - - - 6.2.14 - - - 1.4.1 - - - - - {9545f73c-9c35-4cf6-baae-19a0baebd344} - MapControl.UWP - - - - - MapControl.snk - - - - 14.0 - - - true - - - ..\..\MapControl.snk - - - \ No newline at end of file + + + net9.0-windows10.0.26100.0 + 10.0.17763.0 + true + true + en-US + UWP + MapControl.Projections + XAML Map Control Projections Library for UWP + $(GeneratePackage) + XAML.MapControl.MapProjections.UWP + $(AssemblyTitle) + Map projections library for XAML Map Control, based on ProjNET4GeoAPI + + + + + + + + + + + + + + diff --git a/MapProjections/UWP/Properties/AssemblyInfo.cs b/MapProjections/UWP/Properties/AssemblyInfo.cs deleted file mode 100644 index a69608c8..00000000 --- a/MapProjections/UWP/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("XAML Map Control Projections Library for UWP")] -[assembly: AssemblyProduct("XAML Map Control")] -[assembly: AssemblyCompany("Clemens Fischer")] -[assembly: AssemblyCopyright("Copyright © 2024 Clemens Fischer")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("13.0.0")] -[assembly: AssemblyFileVersion("13.0.0")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] diff --git a/MapProjections/UWP/Properties/MapProjections.UWP.rd.xml b/MapProjections/UWP/Properties/MapProjections.UWP.rd.xml deleted file mode 100644 index d7c78c7f..00000000 --- a/MapProjections/UWP/Properties/MapProjections.UWP.rd.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - diff --git a/MapProjections/WinUI/MapProjections.WinUI.csproj b/MapProjections/WinUI/MapProjections.WinUI.csproj index a1a7b0bb..a27c2d97 100644 --- a/MapProjections/WinUI/MapProjections.WinUI.csproj +++ b/MapProjections/WinUI/MapProjections.WinUI.csproj @@ -1,7 +1,6 @@  - net8.0-windows10.0.17763.0 - win-x86;win-x64;win-arm64 + net9.0-windows10.0.17763.0 true WINUI MapControl.Projections @@ -21,7 +20,7 @@ - + diff --git a/MapUiTools/Avalonia/MapUiTools.Avalonia.csproj b/MapUiTools/Avalonia/MapUiTools.Avalonia.csproj index 7b22c5d8..e6b6c648 100644 --- a/MapUiTools/Avalonia/MapUiTools.Avalonia.csproj +++ b/MapUiTools/Avalonia/MapUiTools.Avalonia.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 AVALONIA MapControl.UiTools XAML Map Control UI Tools Library for Avalonia UI @@ -15,6 +15,6 @@ - + diff --git a/MapUiTools/UWP/MapUiTools.UWP.csproj b/MapUiTools/UWP/MapUiTools.UWP.csproj index 0c6079dd..761a4f6b 100644 --- a/MapUiTools/UWP/MapUiTools.UWP.csproj +++ b/MapUiTools/UWP/MapUiTools.UWP.csproj @@ -1,94 +1,21 @@ - - - - - Debug - AnyCPU - {DFFE8E49-AA07-457E-A459-99326B44F828} - Library - Properties - MapControl.UiTools - MapUiTools.UWP - en-US - UAP - 10.0.26100.0 - 10.0.17763.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;UWP - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - UWP - prompt - 4 - - - PackageReference - - - - MapLayerMenuItem.cs - - - MapProjectionMenuItem.cs - - - MenuButton.cs - - - MapMenuItem.WinUI.cs - - - MenuButton.WinUI.cs - - - - - - - 6.2.14 - - - - - {9545f73c-9c35-4cf6-baae-19a0baebd344} - MapControl.UWP - - - - - MapControl.snk - - - - 14.0 - - - true - - - ..\..\MapControl.snk - - - - \ No newline at end of file + + + net9.0-windows10.0.26100.0 + 10.0.17763.0 + true + true + en-US + UWP + MapControl.UiTools + XAML Map Control UI Tools Library for UWP + + + + + + + + + + + diff --git a/MapUiTools/UWP/Properties/AssemblyInfo.cs b/MapUiTools/UWP/Properties/AssemblyInfo.cs deleted file mode 100644 index 7e8b23c8..00000000 --- a/MapUiTools/UWP/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("XAML Map Control UI Tools Library for UWP")] -[assembly: AssemblyProduct("XAML Map Control")] -[assembly: AssemblyCompany("Clemens Fischer")] -[assembly: AssemblyCopyright("Copyright © 2024 Clemens Fischer")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("13.0.0")] -[assembly: AssemblyFileVersion("13.0.0")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] diff --git a/MapUiTools/UWP/Properties/MapUiTools.UWP.rd.xml b/MapUiTools/UWP/Properties/MapUiTools.UWP.rd.xml deleted file mode 100644 index 75ca7b4f..00000000 --- a/MapUiTools/UWP/Properties/MapUiTools.UWP.rd.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/MapUiTools/WinUI/MapUiTools.WinUI.csproj b/MapUiTools/WinUI/MapUiTools.WinUI.csproj index fd991ce8..388b6c13 100644 --- a/MapUiTools/WinUI/MapUiTools.WinUI.csproj +++ b/MapUiTools/WinUI/MapUiTools.WinUI.csproj @@ -1,7 +1,6 @@  - net8.0-windows10.0.17763.0 - win-x86;win-x64;win-arm64 + net9.0-windows10.0.17763.0 true WINUI MapControl.UiTools @@ -17,7 +16,7 @@ - + diff --git a/SampleApps/AvaloniaApp/AvaloniaApp.csproj b/SampleApps/AvaloniaApp/AvaloniaApp.csproj index 202f15ad..045572dc 100644 --- a/SampleApps/AvaloniaApp/AvaloniaApp.csproj +++ b/SampleApps/AvaloniaApp/AvaloniaApp.csproj @@ -32,12 +32,12 @@ - - - - - + + + + + - + diff --git a/SampleApps/UniversalApp/App.xaml b/SampleApps/UniversalApp/App.xaml index 073c37a1..478ab4bc 100644 --- a/SampleApps/UniversalApp/App.xaml +++ b/SampleApps/UniversalApp/App.xaml @@ -2,7 +2,6 @@ x:Class="SampleApplication.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:SampleApplication" - RequestedTheme="Light"> + xmlns:local="using:SampleApplication"> diff --git a/SampleApps/UniversalApp/App.xaml.cs b/SampleApps/UniversalApp/App.xaml.cs index 3f3ad5b4..9f055ae9 100644 --- a/SampleApps/UniversalApp/App.xaml.cs +++ b/SampleApps/UniversalApp/App.xaml.cs @@ -1,49 +1,34 @@ -using System; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; +using Windows.ApplicationModel.Activation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Navigation; namespace SampleApplication { - sealed partial class App : Application + public sealed partial class App : Application { public App() { InitializeComponent(); - Suspending += OnSuspending; } protected override void OnLaunched(LaunchActivatedEventArgs e) { - Frame rootFrame = Window.Current.Content as Frame; - - if (rootFrame == null) + if (Window.Current.Content is not Frame rootFrame) { rootFrame = new Frame(); - rootFrame.NavigationFailed += OnNavigationFailed; Window.Current.Content = rootFrame; } - if (rootFrame.Content == null) + if (e.PrelaunchActivated == false) { - rootFrame.Navigate(typeof(MainPage), e.Arguments); + if (rootFrame.Content == null) + { + rootFrame.Navigate(typeof(MainPage), e.Arguments); + } + + Window.Current.Activate(); } - - Window.Current.Activate(); - } - - private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - } - - private void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - deferral.Complete(); } } } diff --git a/SampleApps/UniversalApp/MainPage.xaml b/SampleApps/UniversalApp/MainPage.xaml index a3adcad6..fc933ceb 100644 --- a/SampleApps/UniversalApp/MainPage.xaml +++ b/SampleApps/UniversalApp/MainPage.xaml @@ -3,9 +3,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:map="using:MapControl" xmlns:tools="using:MapControl.UiTools" - xmlns:local="using:SampleApplication"> + xmlns:local="using:SampleApplication" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - + diff --git a/SampleApps/UniversalApp/Package.appxmanifest b/SampleApps/UniversalApp/Package.appxmanifest index 0bfe9e19..39d790fd 100644 --- a/SampleApps/UniversalApp/Package.appxmanifest +++ b/SampleApps/UniversalApp/Package.appxmanifest @@ -1,27 +1,48 @@  - - - + + + + + + + - UniversalApp + SampleApplication Clemens Assets\StoreLogo.png + + - + + - - - - + + + + diff --git a/SampleApps/UniversalApp/Properties/AssemblyInfo.cs b/SampleApps/UniversalApp/Properties/AssemblyInfo.cs deleted file mode 100644 index 4e9c8b44..00000000 --- a/SampleApps/UniversalApp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("XAML Map Control UWP Sample Application")] -[assembly: AssemblyProduct("XAML Map Control")] -[assembly: AssemblyCompany("Clemens Fischer")] -[assembly: AssemblyCopyright("Copyright © 2024 Clemens Fischer")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("13.0.0")] -[assembly: AssemblyFileVersion("13.0.0")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] diff --git a/SampleApps/UniversalApp/Properties/Default.rd.xml b/SampleApps/UniversalApp/Properties/Default.rd.xml deleted file mode 100644 index 23c23778..00000000 --- a/SampleApps/UniversalApp/Properties/Default.rd.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/SampleApps/UniversalApp/Properties/PublishProfiles/win-arm64.pubxml b/SampleApps/UniversalApp/Properties/PublishProfiles/win-arm64.pubxml new file mode 100644 index 00000000..3481de2a --- /dev/null +++ b/SampleApps/UniversalApp/Properties/PublishProfiles/win-arm64.pubxml @@ -0,0 +1,13 @@ + + + + + FileSystem + ARM64 + win-arm64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + + \ No newline at end of file diff --git a/SampleApps/UniversalApp/Properties/PublishProfiles/win-x64.pubxml b/SampleApps/UniversalApp/Properties/PublishProfiles/win-x64.pubxml new file mode 100644 index 00000000..4463ecc0 --- /dev/null +++ b/SampleApps/UniversalApp/Properties/PublishProfiles/win-x64.pubxml @@ -0,0 +1,13 @@ + + + + + FileSystem + x64 + win-x64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + + \ No newline at end of file diff --git a/SampleApps/UniversalApp/Properties/PublishProfiles/win-x86.pubxml b/SampleApps/UniversalApp/Properties/PublishProfiles/win-x86.pubxml new file mode 100644 index 00000000..31c51d68 --- /dev/null +++ b/SampleApps/UniversalApp/Properties/PublishProfiles/win-x86.pubxml @@ -0,0 +1,13 @@ + + + + + FileSystem + x86 + win-x86 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + + \ No newline at end of file diff --git a/SampleApps/UniversalApp/Properties/launchSettings.json b/SampleApps/UniversalApp/Properties/launchSettings.json new file mode 100644 index 00000000..bfb7a5b5 --- /dev/null +++ b/SampleApps/UniversalApp/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "UniversalApp": { + "commandName": "MsixPackage" + } + } +} \ No newline at end of file diff --git a/SampleApps/UniversalApp/UniversalApp.csproj b/SampleApps/UniversalApp/UniversalApp.csproj index 04351fbf..4299c319 100644 --- a/SampleApps/UniversalApp/UniversalApp.csproj +++ b/SampleApps/UniversalApp/UniversalApp.csproj @@ -1,129 +1,33 @@ - - - - - Debug - x86 - {AA62B4AA-1CA3-4C20-BEB7-B824D0FC4BD1} - AppContainerExe - Properties - SampleApplication - UniversalApp - en-US - UAP - 10.0.26100.0 - 10.0.17763.0 - 14 - true - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - UniversalApp_TemporaryKey.pfx - 5DCEEAF8B009D22AA0D41EA61710C9CB80E66BD4 - win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot - - - true - bin\x64\Debug\ - DEBUG;UWP - ;2008 - full - x64 - false - prompt - true - false - false - - - bin\x64\Release\ - UWP - true - ;2008 - none - x64 - false - prompt - true - false - false - - - - HyperlinkText.cs - - - MapViewModel.cs - - - ValueConverters.cs - - - App.xaml - - - MainPage.xaml - - - - - - Designer - - - etna.kml - - - - - - 10_535_330.jpg - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - {951bc5d2-d653-42d9-9a91-21dc50de0182} - MapControl.UWP - - - {dffe8e49-aa07-457e-a459-99326b44f828} - MapUiTools.UWP - - - - - 9.0.8 - - - 6.2.14 - - - - 14.0 - - - + + + WinExe + net9.0-windows10.0.26100.0 + 10.0.17763.0 + true + x86;x64;arm64 + win-x86;win-x64;win-arm64 + win-$(Platform).pubxml + en-US + true + true + UWP + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SampleApps/UniversalApp/UniversalApp_TemporaryKey.pfx b/SampleApps/UniversalApp/UniversalApp_TemporaryKey.pfx deleted file mode 100644 index 6fec6f5ce3d6ab5fd242f9644342008078c341ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2512 zcmZXUcR1Vo7stPeNNUGO)l6`?niz>uHEWkrLhHufrBo@QW=o^go~2iZP3&GujM}P5 zDP2|&s=aV2uSQ6v_D-31*FJ=tq zgq-jgpEW(UJ8S@hVIvR{WIW>XXLUbC7Ekh`kC*WNAooS^w&`nFYfbi!`~$}T^Reiz zK2ci@o<88SLaNA4W0qonZr%`D+Dej3Ukm6mD3@M<_%QRdl-BAZ-LCc&_^QG0M~?Kg zx>I*hKaJIbWGwSME29U&)?ip1qUa%tdc0EBvpI@IB{a<6;+ap*UGQoz`omVIvy_t6 zr5G}&yn`?7uLw3S^1F1QKsL$hlI0F-Cs#P_TCZ_AFYU#xtz>a;vX1nw`ssu&P)B2PqS%L~k^{p6RgMA<4Fww$sub6c2b|%eF1NRT`g+%4SOh#0s#0XyudWNP z+2{m{tox}%vO7GQKTGbltxlh?1rX7NtJY}YV)lf;+j9Wjk|K1ZGnY%F zeE)EK@1#``A65O>yY0>Sr1b}ecGp($-oBg#TU9BZMWDw&(3&u2bh3$RL(6Pz&-2F} z1rm4KeSV=fK*vcVs(~vZ^!)ccj?(m|ZV$vfJl;WKW??~dBq_-Lac$z4fsmC{6!VF; zET{6FZ`2R)%vbeXs=9{G6Y}xno6mAF^{!DATLI7QvM%|R071P=Ou~t1ZOw9loaTH1 zF-Tku@+ik=W~X6(EKpID<%90(37l^=$u%D3d`yAFMn@1zE04S9UKgEkDoN>TZ+Ip| z8lW}2unka&TYufX^+o2?<*?KKi*R^P=3`#3oNF4E7aHn`0W(E(yF&H1l04k9Fr=dk z(tUudb2EW#5QTe=vxJY-rdkal!Vi?8;T=JWZwHd6qz?V_n#|shlpFjWyeqiBH)IWN zUrdm+^oHjfm`o%DJf#bDEM61mn|f?OMDt=fIIWPAx8)!@747^qZvMRkhk>j$WQ0VO znBMgQs+!?l{FTnl(@Eml(6LdX8Z5_)&&gIvu^)~EZ$NDLM^Nv?L zpVBi)>qx*>P9g-Q)XAlV5EZi4^n{XM;}g-vC<9?@JNS0dZ9zdvE)8e-~gO*`L8)Rmc1(F~hM!8tC8gqC%#q^rg zcAHawk!ps^yp<&}aZv=C|2x9CmUnr$D(V1}V`j9!09XB8v#-j;(E5$UP5ZAt{dL)< zU%4ZnJ`DF+*e>KQ9CnUTm9H6t5AOP|e^-rfcPY4cAu1jP-s>7Q8@X{GNm1Au51V>Z@2+mzVy%7|Dbr6wqolgi_VpEQ2jb=&Xrbe6Zgw+Um8< z(w_kdq8mykWBr>M^*2sG6!BKupFsoeotW+|=ZvTJeEehgYC6)&TisfF#FcOmdc1YM zl65a`WDvpCxU&u^IVm$e5>y+z@=n9(l$Xx?hUjl*l)aO4OOvXIxM1|5(TComRAzBK zH7!E3oC@mXF_n&pig1|u`5D)+WSi--M4|hS-2sjIz0hEC&jDrPS7+w}o02Bcn z!(;)azcp1xDJQ(B*pu!*?408okuntfb3={+bkyN-rIJ~GCa1rnV z+<*YU4CP za?FP9mxYY=g^XhQtO)k@=`?xmrzy=gJMW|Olu!<ag zqn=+d2xW4TZ%MYxOg#6fn4(B=kU9xD%E=x->EW3!=f|4CL_$t*`%kxr72JH`zq2() z{rTDPH)ky2ORz|Bi58x3kMQE|oZeShwWr%?OBRpiH@X^oE&TNhf2vvxW=GUBZr1BZ zZot<3=lm+2&TAU4T5GvF&U?b-H`LH0YVk^Z{UGa?!IWE$PQAPmO|L$ho8Q%+dJZ+_ z0(5)f>5{ShuV#31#@6Vs>kt(w`=50*G^`$6G|6q#Ia;U|SIuK4VwCUhI?6N!Mtoy2WQMNwZ2rNcy^alk zS1F_%#AA7m7uDgAs2G4(fz|9KW5whmc{AEkXWUjldz!$e$dC4@qv6__ak>=c3Rvm5 zg)T2gK;qJMi>WW;OJzFL%fAW?mK3-$ujS^^NnV_;7p#Od*Kanf*Viwg4Yh0=z_ng7 zUH(tL%3^1&*hUXG!%pjgKNWXc;4i$oFPO3TkzYwrKmqEHx-(n)R+^ye>c4L0amA@r z&8NW)g-@d=A}>p?Po>&SiAlgy3&8qvzU&kG4X|cOiUd bO(VB|;LWsc_-9UaW{Na!sHNBb_0j$W%e!hT diff --git a/SampleApps/WinUiApp/Package.appxmanifest b/SampleApps/WinUiApp/Package.appxmanifest index a29cf0b0..2787884c 100644 --- a/SampleApps/WinUiApp/Package.appxmanifest +++ b/SampleApps/WinUiApp/Package.appxmanifest @@ -31,7 +31,7 @@ Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$"> - - - - - - - @@ -36,8 +29,8 @@ - - + + diff --git a/SampleApps/WpfApplication/WpfApplication.csproj b/SampleApps/WpfApplication/WpfApplication.csproj index 2d82ffea..51ec6272 100644 --- a/SampleApps/WpfApplication/WpfApplication.csproj +++ b/SampleApps/WpfApplication/WpfApplication.csproj @@ -30,7 +30,7 @@ - +