You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
962 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace SlnMesnac.WPF.Converter.AgvAndTask
{
public class AgvNameConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is long nextPointId) // 检查是否为 long 类型
{
return nextPointId switch
{
8 => "3楼叉车",
9 => "2楼叉车",
_ => "未知AGV",
};
}
return "未知AGV"; // 如果值不是 long 类型返回未知AGV
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}