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.

45 lines
1.2 KiB
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 XGL.Tools
{
public class MyValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
// 根据输入值返回对应的输出值 已派发w1未派w0活动w2报工w3
if (value == "w1")
{
return "已派发";
}
else if (value == "w2")
{
return "活动";
}
else if (value == "w3")
{
return "报工";
}
else if (value == "w4")
{
return "暂停";
}
else
{
return "未派";
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
// 如果需要双向绑定,也需要实现 ConvertBack 方法
throw new NotImplementedException();
}
}
}