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.
46 lines
1.2 KiB
C#
46 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.Equals("w1"))
|
|
{
|
|
return "已派发";
|
|
}
|
|
if (value.Equals("w2"))
|
|
{
|
|
return "活动";
|
|
}
|
|
if (value.Equals("w3"))
|
|
{
|
|
return "报工";
|
|
}
|
|
if (value.Equals("w4"))
|
|
{
|
|
return "暂停";
|
|
}
|
|
if(value.Equals("w0"))
|
|
{
|
|
return "未派";
|
|
}
|
|
return "未派";
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
// 如果需要双向绑定,也需要实现 ConvertBack 方法
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|