perf: 优化 Placeholder 提示

This commit is contained in:
uye
2025-05-20 16:55:19 +08:00
parent c902d7c4b2
commit fdff00c3e2
7 changed files with 12 additions and 1 deletions

View File

@@ -286,6 +286,7 @@ You can cancel this popup by clicking the Settings - Issue Report link. Thank yo
<system:String x:Key="ForceGithubGlobalSource">Force using GitHub</system:String>
<system:String x:Key="MirrorChyan">MirrorChyan</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder">Fill after switching source</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder2">Please enter CDK</system:String>
<system:String x:Key="MirrorChyanSelectedButNoCdk">Please go to 「Settings - Update Settings」 to configure MirrorChyan CDK or switch to Global Source.</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">Resource update {0} detected. Please go to 「Settings- Update Settings - Resource Update」 to update manually, or fill in MirrorChayn CDK to update automatically.</system:String>
<system:String x:Key="MirrorChyanResourceUpdateShortTip">Resource update {0} detected</system:String>

View File

@@ -287,6 +287,7 @@
<system:String x:Key="ForceGithubGlobalSource">GitHub を強制使用</system:String>
<system:String x:Key="MirrorChyan">MirrorChyan</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder">更新ソース切替後入力</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder2">CDKを入力してください</system:String>
<system:String x:Key="MirrorChyanSelectedButNoCdk">「設定 - 更新設定」 に移動して MirrorChyan CDK を設定するか、グローバル ソースに切り替えてください。</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">リソース更新 {0} が検出されました。「設定 - 更新設定 - リソース更新」 に移動して手動で更新するか、MirrorChayn CDK を入力して自動的に更新してください。</system:String>
<system:String x:Key="MirrorChyanResourceUpdateShortTip">リソース更新 {0} が検出されました</system:String>

View File

@@ -286,6 +286,7 @@
<system:String x:Key="ForceGithubGlobalSource">GitHub 강제 사용</system:String>
<system:String x:Key="MirrorChyan">MirrorChyan</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder">소스 전환 후 입력</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder2">CDK를 입력해 주세요</system:String>
<system:String x:Key="MirrorChyanSelectedButNoCdk">「설정 - 업데이트 설정」 으로 이동하여 MirrorChyan CDK를 구성하거나 글로벌 소스로 전환하세요.</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">리소스 업데이트 {0}이 감지되었습니다. 「설정 - 업데이트 설정 - 리소스 업데이트」 로 이동하여 수동으로 업데이트하거나, MirrorChyan CDK를 입력하여 자동으로 업데이트하세요.</system:String>
<system:String x:Key="MirrorChyanResourceUpdateShortTip">리소스 업데이트 {0}이 감지되었습니다</system:String>

View File

@@ -287,6 +287,7 @@
<system:String x:Key="ForceGithubGlobalSource">强制使用 GitHub</system:String>
<system:String x:Key="MirrorChyan">Mirror酱</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder">切换更新源后填写</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder2">请输入 CDK</system:String>
<system:String x:Key="MirrorChyanSelectedButNoCdk">请前往 「设置-更新设置」 配置 Mirror酱 CDK 或切换海外源。</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">检测到资源更新: {0}。请前往 「设置-更新设置-资源更新」 手动更新,或配置 Mirror酱 CDK 以自动更新。</system:String>
<system:String x:Key="MirrorChyanResourceUpdateShortTip">检测到资源更新: {0}</system:String>

View File

@@ -286,6 +286,7 @@
<system:String x:Key="ForceGithubGlobalSource">強制使用 GitHub</system:String>
<system:String x:Key="MirrorChyan">MirrorChyan</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder">切換更新源後填寫</system:String>
<system:String x:Key="MirrorChyanCdkPlaceholder2">請輸入 CDK</system:String>
<system:String x:Key="MirrorChyanSelectedButNoCdk">請前往 「設定-更新設定」 設定 MirrorChyan CDK 或切換到全域來源。</system:String>
<system:String x:Key="MirrorChyanResourceUpdateTip">偵測到資源更新: {0}。請前往 「設定-更新設定-資源更新」 手動更新,或設定 MirrorChayn CDK 以自動更新。</system:String>
<system:String x:Key="MirrorChyanResourceUpdateShortTip">偵測到資源更新: {0}</system:String>

View File

@@ -272,6 +272,7 @@ public class VersionUpdateSettingsUserControlModel : PropertyChangedBase
{
SetAndNotify(ref _updateSource, value);
ConfigurationHelper.SetGlobalValue(ConfigurationKeys.UpdateSource, value);
NotifyOfPropertyChange(nameof(MirrorChyanCdkPlaceholder));
}
}
@@ -313,6 +314,11 @@ public class VersionUpdateSettingsUserControlModel : PropertyChangedBase
}
}
public string MirrorChyanCdkPlaceholder =>
UpdateSource != "MirrorChyan"
? LocalizationHelper.GetString("MirrorChyanCdkPlaceholder")
: LocalizationHelper.GetString("MirrorChyanCdkPlaceholder2");
private bool _startupUpdateCheck = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.StartupUpdateCheck, bool.TrueString));
/// <summary>

View File

@@ -137,7 +137,7 @@
Width="150"
HorizontalAlignment="Left"
VerticalAlignment="Center"
hc:InfoElement.Placeholder="{DynamicResource MirrorChyanCdkPlaceholder}"
hc:InfoElement.Placeholder="{Binding MirrorChyanCdkPlaceholder}"
IsEnabled="{c:Binding 'UpdateSource == &quot;MirrorChyan&quot;'}"
IsSafeEnabled="False"
ShowEyeButton="True"