Compare commits

...

4 Commits

Author SHA1 Message Date
4d858e69b8 fix(i18n): 解决绑定值类型检查问题
- 添加类型检查确保只有 BindingBase 类型被直接添加
- 对非 BindingBase 类型的值创建新的 Binding 对象
- 防止运行时类型转换异常
- 提高代码健壮性
2026-01-18 22:55:10 +08:00
623359852b chore(deps): 更新项目依赖项到最新版本
- 将 Avalonia 框架从 11.2.3 版本更新到 11.3.11 版本
- 将 .NET 目标框架从 net9.0 升级到 net10.0
- 更新所有 Avalonia 相关包包括 Desktop、Themes.Fluent 和 Fonts.Inter
- 更新 CommunityToolkit.Mvvm 从 8.2.1 到 8.4.0 版本
- 保持所有诊断包的版本同步更新到 11.3.11
2026-01-18 22:55:00 +08:00
2f18db0de4 chore(project): 升级目标框架到 .NET 10.0
- 将项目目标框架从 net9.0 更新为 net10.0
2026-01-18 22:40:20 +08:00
f396aabaa2 chore(build): 更新解决方案文件格式并调整忽略规则
- 将 .gitignore 中 .idea/ 条目从忽略改为保留
- 新增 *.sln.DotSettings.user 到忽略列表
- 移除旧的 JackCraft.I18N.sln 文件
- 删除用户配置文件 JackCraft.I18N.sln.DotSettings.user
- 添加新的解决方案文件 JackCraft.I18N.slnx 采用新格式
2026-01-18 22:39:29 +08:00
8 changed files with 32 additions and 62 deletions

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@ obj/
riderModule.iml
/_ReSharper.Caches/
.idea/
*.sln.DotSettings.user

View File

@@ -1,34 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JackCraft.I18N", "JackCraft.I18N\JackCraft.I18N.csproj", "{C759B9D3-5362-4F9A-AE9F-FCB8B2E51B9A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Folder", "Solution Folder", "{AEC78522-0B34-4DF2-8373-DDED5BEE6ACB}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
Readme.MD = Readme.MD
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{933A9C2F-8C23-4898-A266-780A841218DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestMvvm", "TestMvvm\TestMvvm.csproj", "{2558A760-25A2-4EA1-8F7B-960C54E1D898}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C759B9D3-5362-4F9A-AE9F-FCB8B2E51B9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C759B9D3-5362-4F9A-AE9F-FCB8B2E51B9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C759B9D3-5362-4F9A-AE9F-FCB8B2E51B9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C759B9D3-5362-4F9A-AE9F-FCB8B2E51B9A}.Release|Any CPU.Build.0 = Release|Any CPU
{933A9C2F-8C23-4898-A266-780A841218DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{933A9C2F-8C23-4898-A266-780A841218DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{933A9C2F-8C23-4898-A266-780A841218DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{933A9C2F-8C23-4898-A266-780A841218DD}.Release|Any CPU.Build.0 = Release|Any CPU
{2558A760-25A2-4EA1-8F7B-960C54E1D898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2558A760-25A2-4EA1-8F7B-960C54E1D898}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2558A760-25A2-4EA1-8F7B-960C54E1D898}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2558A760-25A2-4EA1-8F7B-960C54E1D898}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@@ -1,11 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEffectiveValue_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F5a525a9d918b377baff5efc711876365dd6b28a67a526bca563509277c197_003FEffectiveValue_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIValueConverter_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F0d5de909919040338555601dd29873191e2000_003F6e_003F156c671e_003FIValueConverter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AManifestBasedResourceGroveler_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Faa4010d4409494a18f9356117451768ad29a90b7ff96ac80dd7d963d6b383_003FManifestBasedResourceGroveler_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMultiBinding_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F5cfc269cf6784f4a9dec8ed13ac9f75de600_003F49_003F860db364_003FMultiBinding_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATest_002EMainWindow_002Eg_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F1beb137ab36b71a8961f85c524c65a73ff2463ed_003FTest_002EMainWindow_002Eg_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6d2342c247c64eb7a9b3702e481e4443f83e00_003Fc7_003F71d96ba5_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F4743f513c7ddc8411223a46f0ca426ed929391acebcff993721dff2f0c6b34_003FThrowHelper_002Ecs_002Fz_003A2_002D1/@EntryIndexedValue">ForceIncluded</s:String>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=TestMvvm_002FAssets_002FResources/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=Test_002FAssets_002FResources/@EntryIndexedValue">False</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>

9
JackCraft.I18N.slnx Normal file
View File

@@ -0,0 +1,9 @@
<Solution>
<Folder Name="/Solution Folder/">
<File Path="LICENSE" />
<File Path="Readme.MD" />
</Folder>
<Project Path="JackCraft.I18N/JackCraft.I18N.csproj" />
<Project Path="Test/Test.csproj" />
<Project Path="TestMvvm/TestMvvm.csproj" />
</Solution>

View File

@@ -20,6 +20,11 @@ internal class I18NBinding : MultiBinding
Bindings.Add(new Binding { Source = I18NConfig.Manager, Path = nameof(I18NConfig.Manager.Culture) });
Bindings.Add(new Binding { Source = key });
foreach (var value in values)
Bindings.Add(value);
{
if (value is BindingBase binding)
Bindings.Add(binding);
else
Bindings.Add(new Binding { Source = value });
}
}
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latestmajor</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3"/>
<PackageReference Include="Avalonia" Version="11.3.11" />
</ItemGroup>
</Project>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
@@ -9,12 +9,12 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3"/>
<PackageReference Include="Avalonia.Desktop" Version="11.2.3"/>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3"/>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3"/>
<PackageReference Include="Avalonia" Version="11.3.11" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.11" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.11" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.11" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Include="Avalonia.Diagnostics" Version="11.2.3">
<PackageReference Include="Avalonia.Diagnostics" Version="11.3.11">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
@@ -14,16 +14,16 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.3"/>
<PackageReference Include="Avalonia.Desktop" Version="11.2.3"/>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3"/>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3"/>
<PackageReference Include="Avalonia" Version="11.3.11" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.11" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.11" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.11" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Include="Avalonia.Diagnostics" Version="11.2.3">
<PackageReference Include="Avalonia.Diagnostics" Version="11.3.11">
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1"/>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
</ItemGroup>
<ItemGroup>