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.
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using SlnMesnac.Model.enums;
|
|
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace SlnMesnac.WPF.Converter.ProdMgmt;
|
|
|
|
public class PlanStatusConverter: IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value == null)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
PlanStatusEnum info = (PlanStatusEnum)value;
|
|
string result = "";
|
|
switch (info)
|
|
{
|
|
case PlanStatusEnum.待执行:
|
|
result = "待执行";
|
|
break;
|
|
case PlanStatusEnum.已开始:
|
|
result = "已开始";
|
|
break;
|
|
case PlanStatusEnum.已完成:
|
|
result = "已完成";
|
|
break;
|
|
default:
|
|
result = "待执行";
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
} |