修改了设备列表的界面

This commit is contained in:
2025-09-14 20:46:31 +08:00
parent ebf67b98fa
commit d923b6a116
10 changed files with 469 additions and 149 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace DMS.WPF.Converters
{
/// <summary>
/// 布尔值到字符串转换器。根据布尔值返回不同的字符串。
/// 参数格式: "TrueString;FalseString"
/// </summary>
public class BoolToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool boolValue)
{
string param = parameter as string;
if (!string.IsNullOrEmpty(param))
{
string[] strings = param.Split(';');
if (strings.Length == 2)
{
return boolValue ? strings[0] : strings[1];
}
}
// 默认返回
return boolValue ? "是" : "否";
}
return "未知";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}