From 9e21c22c1f4c9cc6ccbc1a61a5448d7f30a4b2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E6=80=A1=E9=A3=9E?= <363301617@qq.com> Date: Fri, 7 Jun 2024 12:48:49 +0800 Subject: [PATCH] Update Windows App SDK 1.6.0-experimental1 1.Update Windows App SDK 1.6.0-experimental1 2.Update CsWinRT to 2.1.0-preview1 to test NativeAOT 3.Fix AboutPage theme display bug --- GetStoreApp/GetStoreApp.csproj | 96 +++++++++--------- GetStoreApp/GetStoreApp.res | Bin 438024 -> 438024 bytes GetStoreApp/Properties/AssemblyInfo.cs | 6 +- GetStoreApp/Views/Pages/AboutPage.xaml | 2 +- GetStoreApp/Views/Windows/MainWindow.xaml | 41 ++------ GetStoreApp/Views/Windows/MainWindow.xaml.cs | 5 +- GetStoreApp/WinUIApp.xaml.cs | 5 +- GetStoreAppPackage/GetStoreAppPackage.wapproj | 1 - GetStoreAppPackage/Package.appxmanifest | 2 +- GetStoreAppWebView/GetStoreAppWebView.csproj | 21 ++-- GetStoreAppWebView/GetStoreAppWebView.res | Bin 438092 -> 438092 bytes GetStoreAppWebView/Properties/AssemblyInfo.cs | 6 +- .../Interop/DataTransferManagerInterop.cs | 46 --------- .../IIDataTransferManagerInteropMethods.cs | 36 ------- ...ft.Management.Deployment.Projection.csproj | 11 +- .../Properties/AssemblyInfo.cs | 6 +- 16 files changed, 87 insertions(+), 197 deletions(-) delete mode 100644 Microsoft.Management.Deployment.Projection/Interop/DataTransferManagerInterop.cs delete mode 100644 Microsoft.Management.Deployment.Projection/Interop/IIDataTransferManagerInteropMethods.cs diff --git a/GetStoreApp/GetStoreApp.csproj b/GetStoreApp/GetStoreApp.csproj index 21555a2a..e172116f 100644 --- a/GetStoreApp/GetStoreApp.csproj +++ b/GetStoreApp/GetStoreApp.csproj @@ -22,14 +22,14 @@ x86;x64;ARM64 FileSystem False + true True true PackageReference GetStoreApp win-x86;win-x64;win-arm64 - true GetStoreApp.Program - net9.0-windows10.0.26100.0 + net9.0-windows10.0.22621.0 10.0.19041.0 partial true @@ -39,7 +39,7 @@ false false MSIX - 10.0.26100.1 + 10.0.22621.35-preview @@ -118,53 +118,53 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + diff --git a/GetStoreApp/GetStoreApp.res b/GetStoreApp/GetStoreApp.res index 2106e6617f1c3aed0495cf78368b11baefb96750..b78551f7848867bfdae95b4f381e90cdb72d8336 100644 GIT binary patch delta 59 zcmeCUC)IIJs-cCkg{g(Pg{6gc3!Bm`&UhvU1{MYehWP2)v)FnW&8P32#kQN#e0%9^ Owqiyg{c;YQybu5|Z4zAo delta 59 zcmeCUC)IIJs-cCkg{g(Pg{6gc3!Bm`&S)kE1{MYehUn?qv)FnWji>LN#kQN#czfw= Owqiyg{c;YQybu5`wGv4H diff --git a/GetStoreApp/Properties/AssemblyInfo.cs b/GetStoreApp/Properties/AssemblyInfo.cs index 6927f55d..058f2883 100644 --- a/GetStoreApp/Properties/AssemblyInfo.cs +++ b/GetStoreApp/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ [assembly: AssemblyCompany("高怡飞")] [assembly: AssemblyCopyright("Copyright ©2022-2024 高怡飞, All Rights Reserved.")] [assembly: AssemblyDescription("获取商店应用")] -[assembly: AssemblyFileVersion("4.0.603.0")] -[assembly: AssemblyInformationalVersion("4.0.603.0")] +[assembly: AssemblyFileVersion("4.0.607.0")] +[assembly: AssemblyInformationalVersion("4.0.607.0")] [assembly: AssemblyProduct("获取商店应用")] [assembly: AssemblyTitle("获取商店应用")] -[assembly: AssemblyVersion("4.0.603.0")] +[assembly: AssemblyVersion("4.0.607.0")] // 应用程序默认区域性的资源控制器设置 [assembly: NeutralResourcesLanguage("en-us")] diff --git a/GetStoreApp/Views/Pages/AboutPage.xaml b/GetStoreApp/Views/Pages/AboutPage.xaml index 7e489f7b..7dc8a627 100644 --- a/GetStoreApp/Views/Pages/AboutPage.xaml +++ b/GetStoreApp/Views/Pages/AboutPage.xaml @@ -583,7 +583,7 @@ Padding="0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" - Background="{StaticResource CardBackgroundFillColorDefaultBrush}" + Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" IsExpanded="True"> diff --git a/GetStoreApp/Views/Windows/MainWindow.xaml b/GetStoreApp/Views/Windows/MainWindow.xaml index b225fca2..fbab32ab 100644 --- a/GetStoreApp/Views/Windows/MainWindow.xaml +++ b/GetStoreApp/Views/Windows/MainWindow.xaml @@ -108,38 +108,17 @@ - - - - - - - - - - - - + VerticalContentAlignment="Center"> + + + + + private void OnLoaded(object sender, RoutedEventArgs args) { + SetTitleBarTheme((Content as FrameworkElement).ActualTheme); + // 导航控件加载完成后初始化内容 NavigationView navigationView = sender as NavigationView; diff --git a/GetStoreApp/WinUIApp.xaml.cs b/GetStoreApp/WinUIApp.xaml.cs index ea3e836c..3265a216 100644 --- a/GetStoreApp/WinUIApp.xaml.cs +++ b/GetStoreApp/WinUIApp.xaml.cs @@ -38,6 +38,7 @@ public WinUIApp() protected override void OnLaunched(LaunchActivatedEventArgs args) { base.OnLaunched(args); + Window = new MainWindow(); MainWindow.Current.Show(true); SetAppIcon(); @@ -161,12 +162,12 @@ protected virtual void Dispose(bool disposing) User32Library.ChangeWindowMessageFilterEx((IntPtr)MainWindow.Current.AppWindow.Id.Value, WindowMessage.WM_COPYDATA, ChangeFilterAction.MSGFLT_RESET, in changeFilterStatus); } - MainWindow.Current.SaveWindowInformation(); + MainWindow.Current?.SaveWindowInformation(); DownloadSchedulerService.CloseDownloadScheduler(true); isDisposed = true; } - Environment.Exit(Environment.ExitCode); + Exit(); } } } diff --git a/GetStoreAppPackage/GetStoreAppPackage.wapproj b/GetStoreAppPackage/GetStoreAppPackage.wapproj index 08507d3e..c565d36e 100644 --- a/GetStoreAppPackage/GetStoreAppPackage.wapproj +++ b/GetStoreAppPackage/GetStoreAppPackage.wapproj @@ -106,7 +106,6 @@ --> - diff --git a/GetStoreAppPackage/Package.appxmanifest b/GetStoreAppPackage/Package.appxmanifest index 2faed00d..58a0eca4 100644 --- a/GetStoreAppPackage/Package.appxmanifest +++ b/GetStoreAppPackage/Package.appxmanifest @@ -11,7 +11,7 @@ + Version="4.0.607.0" /> ms-resource:PackageDisplayName diff --git a/GetStoreAppWebView/GetStoreAppWebView.csproj b/GetStoreAppWebView/GetStoreAppWebView.csproj index b5b74970..85be673c 100644 --- a/GetStoreAppWebView/GetStoreAppWebView.csproj +++ b/GetStoreAppWebView/GetStoreAppWebView.csproj @@ -23,14 +23,14 @@ FileSystem False True - true + true PackageReference GetStoreApp win-x86;win-x64;win-arm64 GetStoreAppWebView.Program - net9.0-windows10.0.26100.0 + net9.0-windows10.0.22621.0 10.0.19041.0 - partial + full true true GetStoreAppWebView.res @@ -38,7 +38,7 @@ false false MSIX - 10.0.26100.1 + 10.0.22621.35-preview @@ -62,12 +62,12 @@ - + - - + + @@ -96,11 +96,4 @@ - - - - - - - \ No newline at end of file diff --git a/GetStoreAppWebView/GetStoreAppWebView.res b/GetStoreAppWebView/GetStoreAppWebView.res index 2e8fa5773017b4288c20b9ba2d74422c60f60017..f586e9376a14e9fb2aa7c55c5fad746c8fdb86d6 100644 GIT binary patch delta 59 zcmX?ePwLD)sfHHD7N!>F7M2#)Eo@4&IOCZZ7+4q>7~-dE&tmIkG@rh67TaY;^XY2CSO@F7M2#)Eo@4&IHQ>u7+4q>7^0_Z&tmIkG@ib57TaY;Y2CSO@ - /// DataTransferManager 互操作辅助类 - /// 允许访问管理多个窗口的 Windows 应用商店应用中的 DataTransferManager 方法。 - /// 临时放在 Microsoft.Management.Deployment.Projection 程序集中 - /// 因为 CS0122,WinRT.FactoryObjectReference 和 WinRT.ActivationFactory 类不可访问,因为它具有一定的保护级别 - /// 等待 CsWinRT 官方仓库合并后,该段临时代码会直接移除 - /// - public static class DataTransferManagerInterop - { - private static readonly Guid IDataTransferManagerInterop_IID = new("3A3DCD6C-3EAB-43DC-BCDE-45671CE800C8"); - - private static readonly Guid riid = new("A5CAEE9B-8708-49D1-8D36-67D25A8DA00C"); - - private static readonly FactoryObjectReference factoryObjectReference; - - static DataTransferManagerInterop() - { - // typeName = typeof(Windows.ApplicationModel.DataTransfer.DataTransferManager).FullName - factoryObjectReference = ActivationFactory.Get("Windows.ApplicationModel.DataTransfer.DataTransferManager", IDataTransferManagerInterop_IID); - } - - /// - /// 获取指定窗口的 DataTransferManager 实例。 - /// - /// 要检索其 DataTransferManager 实例的窗口。 - /// 返回 DataTransferManager 实例。 - public static DataTransferManager GetForWindow(IntPtr appWindow) - { - return IDataTransferManagerInteropMethods.GetForWindow(factoryObjectReference, appWindow, riid); - } - - /// - /// 显示用于共享指定窗口内容的 UI。 - /// - /// 显示共享 UI 的窗口。 - public static void ShowShareUIForWindow(IntPtr appWindow) - { - IDataTransferManagerInteropMethods.ShowShowShareUIForWindow(factoryObjectReference, appWindow); - } - } -} diff --git a/Microsoft.Management.Deployment.Projection/Interop/IIDataTransferManagerInteropMethods.cs b/Microsoft.Management.Deployment.Projection/Interop/IIDataTransferManagerInteropMethods.cs deleted file mode 100644 index 9046ee3d..00000000 --- a/Microsoft.Management.Deployment.Projection/Interop/IIDataTransferManagerInteropMethods.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using WinRT; - -namespace Windows.ApplicationModel.DataTransfer -{ - /// - /// 等效调用 IDataTransferManagerInterop 接口的方法 - /// - internal static class IDataTransferManagerInteropMethods - { - internal static unsafe DataTransferManager GetForWindow(IObjectReference _obj, IntPtr appWindow, in Guid riid) - { - IntPtr thisPtr = _obj.ThisPtr; - IntPtr ptr = new(); - - try - { - // IDataTransferManagerInterop 继承了 IUnknown (3 个函数),并提供了 GetForWindow,总共提供了5个函数 - ExceptionHelpers.ThrowExceptionForHR((*(delegate* unmanaged[Stdcall]**)thisPtr)[3](thisPtr, appWindow, riid, out ptr)); - return MarshalInspectable.FromAbi(ptr); - } - finally - { - MarshalInspectable.DisposeAbi(ptr); - } - } - - internal static unsafe void ShowShowShareUIForWindow(IObjectReference _obj, IntPtr appWindow) - { - IntPtr thisPtr = _obj.ThisPtr; - - // IDataTransferManagerInterop 继承了 IUnknown (3 个函数),并提供了 ShowShowShareUIForWindow,总共提供了5个函数 - ExceptionHelpers.ThrowExceptionForHR((*(delegate* unmanaged[Stdcall]**)thisPtr)[4](thisPtr, appWindow)); - } - } -} diff --git a/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj b/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj index c26610c8..3e550dfe 100644 --- a/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj +++ b/Microsoft.Management.Deployment.Projection/Microsoft.Management.Deployment.Projection.csproj @@ -1,15 +1,16 @@  - Microsoft.Management.Deployment - 10.0.26100.0 + 10.0.22621.0 true false true x64;x86;ARM64 - net9.0-windows10.0.26100.0 + true + full + net9.0-windows10.0.22621.0 10.0.19041.0 - 10.0.26100.1 + 10.0.22621.35-preview @@ -35,7 +36,7 @@ - + diff --git a/Microsoft.Management.Deployment.Projection/Properties/AssemblyInfo.cs b/Microsoft.Management.Deployment.Projection/Properties/AssemblyInfo.cs index fa142bc3..7c30836c 100644 --- a/Microsoft.Management.Deployment.Projection/Properties/AssemblyInfo.cs +++ b/Microsoft.Management.Deployment.Projection/Properties/AssemblyInfo.cs @@ -4,10 +4,10 @@ // 程序集信息设置 [assembly: AssemblyCompany("高怡飞")] [assembly: AssemblyCopyright("©Copyright ©2022-2024 高怡飞, All Rights Reserved.")] -[assembly: AssemblyFileVersion("4.0.603.0")] -[assembly: AssemblyInformationalVersion("4.0.603.0")] +[assembly: AssemblyFileVersion("4.0.607.0")] +[assembly: AssemblyInformationalVersion("4.0.607.0")] [assembly: AssemblyProduct("获取商店应用 WinGet WinRT 扩展")] -[assembly: AssemblyVersion("4.0.603.0")] +[assembly: AssemblyVersion("4.0.607.0")] // 设置程序集仅允许在Windows平台上可用 [assembly: SupportedOSPlatform("windows10.0.26100")] \ No newline at end of file