更新setting

This commit is contained in:
GukSang.Jin
2026-01-29 11:36:15 +08:00
parent 5cd64e4134
commit ead1b99aa8

View File

@@ -22,11 +22,20 @@ namespace COFTester.Views
{ {
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{ {
if (values.Length < 3 || values[0] == null || values[1] == null || values[2] == null) // 检查是否有足够的值
if (values == null || values.Length < 3)
return "-";
// 检查是否有 UnsetValue 或 null
if (values[0] == System.Windows.DependencyProperty.UnsetValue ||
values[1] == System.Windows.DependencyProperty.UnsetValue ||
values[2] == System.Windows.DependencyProperty.UnsetValue)
return "-";
// 安全地转换布尔值
if (!(values[0] is bool direction1) || !(values[1] is bool direction2))
return "-"; return "-";
bool direction1 = (bool)values[0];
bool direction2 = (bool)values[1];
var lang = LanguageResources.Instance; var lang = LanguageResources.Instance;
string directionType = parameter as string ?? ""; string directionType = parameter as string ?? "";