diff --git a/GetStoreApp/GetStoreApp.csproj b/GetStoreApp/GetStoreApp.csproj index 11d2fbdc6..a379ab075 100644 --- a/GetStoreApp/GetStoreApp.csproj +++ b/GetStoreApp/GetStoreApp.csproj @@ -22,15 +22,14 @@ False WinExe x86;x64;ARM64 + true FileSystem False true True - true PackageReference GetStoreApp win-x86;win-x64;win-arm64 - true GetStoreApp.Program net9.0-windows10.0.26100.0 10.0.19041.0 @@ -110,7 +109,8 @@ - + + diff --git a/GetStoreApp/GetStoreApp.res b/GetStoreApp/GetStoreApp.res index 20d4c0bdd..e07718a52 100644 Binary files a/GetStoreApp/GetStoreApp.res and b/GetStoreApp/GetStoreApp.res differ diff --git a/GetStoreApp/Helpers/Controls/Extensions/ContentDialogHelper.cs b/GetStoreApp/Helpers/Controls/Extensions/ContentDialogHelper.cs index e8e074f0d..d97e47cc7 100644 --- a/GetStoreApp/Helpers/Controls/Extensions/ContentDialogHelper.cs +++ b/GetStoreApp/Helpers/Controls/Extensions/ContentDialogHelper.cs @@ -6,7 +6,7 @@ namespace GetStoreApp.Helpers.Controls.Extensions { /// - /// 扩展后的内容对话框辅助类,只允许在同一时间段内打开一个内容对话框 + /// 扩展后的内容对话框控件辅助类 /// public static class ContentDialogHelper { diff --git a/GetStoreApp/Helpers/Controls/Extensions/TeachingTipHelper.cs b/GetStoreApp/Helpers/Controls/Extensions/TeachingTipHelper.cs index 002fa3cb8..3098420f6 100644 --- a/GetStoreApp/Helpers/Controls/Extensions/TeachingTipHelper.cs +++ b/GetStoreApp/Helpers/Controls/Extensions/TeachingTipHelper.cs @@ -7,7 +7,7 @@ namespace GetStoreApp.Helpers.Controls.Extensions { /// - /// 扩展后的教学提示辅助类,使用教学提示来显示应用内通知 + /// 扩展后的教学提示控件辅助类 /// public static class TeachingTipHelper { diff --git a/GetStoreApp/Helpers/Controls/Extensions/ToggleSwitchHelper.cs b/GetStoreApp/Helpers/Controls/Extensions/ToggleSwitchHelper.cs new file mode 100644 index 000000000..4d0d5859c --- /dev/null +++ b/GetStoreApp/Helpers/Controls/Extensions/ToggleSwitchHelper.cs @@ -0,0 +1,18 @@ +using Microsoft.UI.Xaml; + +namespace GetStoreApp.Helpers.Controls.Extensions +{ + /// + /// 扩展后的切换开关控件辅助类 + /// + public static class ToggleSwitchHelper + { + /// + /// 获取 ToggleSwitch 的文字转向 + /// + public static FlowDirection GetFlowDirection(FlowDirection flowDirection) + { + return flowDirection is FlowDirection.LeftToRight ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; + } + } +} diff --git a/GetStoreApp/Properties/AssemblyInfo.cs b/GetStoreApp/Properties/AssemblyInfo.cs index 94ca72950..5e39e7a01 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.5.815.0")] -[assembly: AssemblyInformationalVersion("4.5.815.0")] +[assembly: AssemblyFileVersion("4.6.816.0")] +[assembly: AssemblyInformationalVersion("4.6.816.0")] [assembly: AssemblyProduct("获取商店应用")] [assembly: AssemblyTitle("获取商店应用")] -[assembly: AssemblyVersion("4.5.815.0")] +[assembly: AssemblyVersion("4.6.816.0")] // 应用程序默认区域性的资源控制器设置 [assembly: NeutralResourcesLanguage("en-us")] diff --git a/GetStoreApp/Views/Pages/SettingsPage.xaml b/GetStoreApp/Views/Pages/SettingsPage.xaml index 4364f291d..0a78e720f 100644 --- a/GetStoreApp/Views/Pages/SettingsPage.xaml +++ b/GetStoreApp/Views/Pages/SettingsPage.xaml @@ -3,6 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:collection="using:System.Collections" + xmlns:controlHelper="using:GetStoreApp.Helpers.Controls.Extensions" xmlns:converter="using:GetStoreApp.Helpers.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helper="using:GetStoreApp.Helpers.Root" @@ -350,7 +351,7 @@ Grid.Column="2" MinWidth="0" Margin="0,-2,0,0" - FlowDirection="{x:Bind GetToggleSwitchDirection(service:LanguageService.FlowDirection)}" + FlowDirection="{x:Bind controlHelper:ToggleSwitchHelper.GetFlowDirection(service:LanguageService.FlowDirection)}" IsEnabled="{x:Bind converter:ValueCheckConverterHelper.ObjectCompareReverseConvert(Backdrop.Value, BackdropList[0].Value), Mode=OneWay}" IsEnabledChanged="{x:Bind OnIsEnabledChanged}" IsOn="{x:Bind AlwaysShowBackdropValue, Mode=OneWay}" @@ -520,7 +521,7 @@ Grid.Column="2" MinWidth="0" Margin="0,-2,0,0" - FlowDirection="{x:Bind GetToggleSwitchDirection(service:LanguageService.FlowDirection)}" + FlowDirection="{x:Bind controlHelper:ToggleSwitchHelper.GetFlowDirection(service:LanguageService.FlowDirection)}" IsOn="{x:Bind TopMostValue, Mode=OneWay}" OffContent="{x:Bind root:ResourceService.GetLocalized('Settings/TopMostOffContent')}" OnContent="{x:Bind root:ResourceService.GetLocalized('Settings/TopMostOnContent')}" @@ -604,7 +605,7 @@ Grid.Column="3" MinWidth="0" Margin="0,-2,0,0" - FlowDirection="{x:Bind GetToggleSwitchDirection(service:LanguageService.FlowDirection)}" + FlowDirection="{x:Bind controlHelper:ToggleSwitchHelper.GetFlowDirection(service:LanguageService.FlowDirection)}" IsOn="{x:Bind Notification, Mode=OneWay}" OffContent="{x:Bind root:ResourceService.GetLocalized('Settings/NotificationOffContent')}" OnContent="{x:Bind root:ResourceService.GetLocalized('Settings/NotificationOnContent')}" @@ -843,7 +844,7 @@ - /// 获取 ToggleSwitch 的文字转向 - /// - private FlowDirection GetToggleSwitchDirection(FlowDirection flowDirection) - { - return flowDirection is FlowDirection.LeftToRight ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; - } - private string LocalizeDisplayNumber(DictionaryEntry selectedBackdrop) { int index = BackdropList.FindIndex(item => item.Value.Equals(selectedBackdrop.Value)); diff --git a/GetStoreAppPackage/Package.appxmanifest b/GetStoreAppPackage/Package.appxmanifest index 0143d4475..274c515bc 100644 --- a/GetStoreAppPackage/Package.appxmanifest +++ b/GetStoreAppPackage/Package.appxmanifest @@ -11,7 +11,7 @@ + Version="4.6.816.0" /> ms-resource:PackageDisplayName diff --git a/GetStoreAppWebView/GetStoreAppWebView.csproj b/GetStoreAppWebView/GetStoreAppWebView.csproj index d6281e474..9aa8d5553 100644 --- a/GetStoreAppWebView/GetStoreAppWebView.csproj +++ b/GetStoreAppWebView/GetStoreAppWebView.csproj @@ -146,9 +146,8 @@ - + - 14.0 diff --git a/GetStoreAppWebView/Pages/MainPage.xaml.cs b/GetStoreAppWebView/Pages/MainPage.xaml.cs index 433d0a1e4..2cb6be877 100644 --- a/GetStoreAppWebView/Pages/MainPage.xaml.cs +++ b/GetStoreAppWebView/Pages/MainPage.xaml.cs @@ -270,7 +270,9 @@ private async void OnClearWebCacheClicked(object sender, RoutedEventArgs args) { if (WebView2Browser is not null && WebView2Browser.CoreWebView2 is not null) { + WebView2Browser.CoreWebView2.CookieManager.DeleteAllCookies(); await WebView2Browser.CoreWebView2.Profile.ClearBrowsingDataAsync(); + await WebView2Browser.CoreWebView2.ClearServerCertificateErrorActionsAsync(); } } } @@ -373,6 +375,8 @@ private async void OnCoreProcessFailed(object sender, CoreWebView2ProcessFailedE /// private void OnCoreWebView2Initialized(object sender, CoreWebView2InitializedEventArgs args) { + WebView2Browser.CoreWebView2.Settings.AreDefaultScriptDialogsEnabled = false; + WebView2Browser.CoreWebView2.Settings.AreDevToolsEnabled = false; WebView2Browser.CoreWebView2.NewWindowRequested += OnCoreWebViewNewWindowRequested; WebView2Browser.CoreWebView2.SourceChanged += OnSourceChanged; IsEnabled = true; @@ -461,27 +465,5 @@ private void SetTitleBarTheme(ElementTheme theme) } #endregion 第五部分:窗口属性设置 - - /// - /// 关闭窗口时注销的事件 - /// - public void CloseWindow() - { - if (WebKernelService.WebKernel == WebKernelService.WebKernelList[1] && WebView2Browser is not null) - { - try - { - if (WebView2Browser.CoreWebView2 is not null) - { - WebView2Browser.CoreWebView2.NewWindowRequested -= OnCoreWebViewNewWindowRequested; - WebView2Browser.CoreWebView2.SourceChanged -= OnSourceChanged; - } - } - catch (Exception e) - { - LogService.WriteLog(LoggingLevel.Error, "WebView2 unloaded event failed", e); - } - } - } } } diff --git a/GetStoreAppWebView/Properties/AssemblyInfo.cs b/GetStoreAppWebView/Properties/AssemblyInfo.cs index af06a86d7..0b2e4f1e7 100644 --- a/GetStoreAppWebView/Properties/AssemblyInfo.cs +++ b/GetStoreAppWebView/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ [assembly: AssemblyCompany("高怡飞")] [assembly: AssemblyCopyright("Copyright ©2022-2024 高怡飞, All Rights Reserved.")] [assembly: AssemblyDescription("网页浏览器")] -[assembly: AssemblyFileVersion("4.5.815.0")] -[assembly: AssemblyInformationalVersion("4.5.815.0")] +[assembly: AssemblyFileVersion("4.6.816.0")] +[assembly: AssemblyInformationalVersion("4.6.816.0")] [assembly: AssemblyProduct("网页浏览器")] [assembly: AssemblyTitle("网页浏览器")] -[assembly: AssemblyVersion("4.5.815.0")] +[assembly: AssemblyVersion("4.6.816.0")] // 应用程序默认区域性的资源控制器设置 [assembly: NeutralResourcesLanguage("en-us")] diff --git a/GetStoreAppWebView/UI/Controls/WebView2.cs b/GetStoreAppWebView/UI/Controls/WebView2.cs index 4c2d06d54..a1505c0b4 100644 --- a/GetStoreAppWebView/UI/Controls/WebView2.cs +++ b/GetStoreAppWebView/UI/Controls/WebView2.cs @@ -750,10 +750,7 @@ private void OnCursorChanged(CoreWebView2CompositionController sender, object ar private async void OnTextScaleFactorChanged(UISettings sender, object args) { // OnTextScaleFactorChanged 发生在非 UI 线程中,使用 Dispatcher 在 UI 线程中调用 UpdateCoreWebViewScale。 - await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => - { - UpdateCoreWebViewScale(); - }); + await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, UpdateCoreWebViewScale); } #endregion 第六部分:自定义事件 diff --git a/Microsoft.Management.Deployment.Projection/Properties/AssemblyInfo.cs b/Microsoft.Management.Deployment.Projection/Properties/AssemblyInfo.cs index 157d7eae6..a421574c5 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.5.815.0")] -[assembly: AssemblyInformationalVersion("4.5.815.0")] +[assembly: AssemblyFileVersion("4.6.816.0")] +[assembly: AssemblyInformationalVersion("4.6.816.0")] [assembly: AssemblyProduct("获取商店应用 WinGet WinRT 扩展")] -[assembly: AssemblyVersion("4.5.815.0")] +[assembly: AssemblyVersion("4.6.816.0")] // 设置程序集仅允许在Windows平台上可用 [assembly: SupportedOSPlatform("windows10.0.26100")] \ No newline at end of file