add:兼容性变更提示

This commit is contained in:
2026-04-18 17:23:21 +08:00
parent 1640238728
commit 51dcc374ce
5 changed files with 170 additions and 2 deletions
+23 -1
View File
@@ -267,7 +267,7 @@ namespace Ink_Canvas
ToggleSwitchIsAutoUpdate.IsOn = Settings.Startup.IsAutoUpdate;
// 只有在启用了自动更新功能时才检查更新
if (Settings.Startup.IsAutoUpdate && !skipAutoUpdateCheck)
if (Settings.Startup.IsAutoUpdate && Settings.Startup.HasConfirmedNetCompatibilityChange && !skipAutoUpdateCheck)
{
if (isStartup)
{
@@ -288,6 +288,8 @@ namespace Ink_Canvas
ToggleSwitchIsAutoUpdateWithSilence.IsOn = true;
}
ApplyNetCompatibilityConfirmationGateToUpdateSettingsUi();
// 初始化更新通道选择
foreach (var radioButton in UpdateChannelSelector.Items)
{
@@ -1317,6 +1319,26 @@ namespace Ink_Canvas
try { RefreshConfigProfileList(); } catch (Exception ex) { LogHelper.WriteLogToFile($"刷新配置文件列表失败: {ex.Message}", LogHelper.LogType.Warning); }
}
private void ApplyNetCompatibilityConfirmationGateToUpdateSettingsUi()
{
bool confirmed = Settings?.Startup?.HasConfirmedNetCompatibilityChange == true;
if (Net472CompatibilityWarningPanel != null)
{
Net472CompatibilityWarningPanel.Visibility = confirmed ? Visibility.Collapsed : Visibility.Visible;
}
if (ToggleSwitchIsAutoUpdate != null)
{
ToggleSwitchIsAutoUpdate.IsEnabled = confirmed;
}
if (ToggleSwitchIsAutoUpdateWithSilence != null)
{
ToggleSwitchIsAutoUpdateWithSilence.IsEnabled = confirmed;
}
}
/// <summary>
/// 将画笔自动恢复相关的设置应用到界面控件并在启用时初始化自动恢复定时器。
/// </summary>