添加项目文件。
This commit is contained in:
41
UIShare/Converters/ParameterCategoryToStringConverter.cs
Normal file
41
UIShare/Converters/ParameterCategoryToStringConverter.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using static UIShare.UIViewModel.ParameterModel;
|
||||
|
||||
|
||||
|
||||
namespace UIShare.Converters
|
||||
{
|
||||
public class ParameterCategoryToStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
|
||||
if (value is ParameterCategory category)
|
||||
{
|
||||
switch (category)
|
||||
{
|
||||
case ParameterCategory.Input:
|
||||
return "输入";
|
||||
case ParameterCategory.Output:
|
||||
return "输出";
|
||||
case ParameterCategory.Temp:
|
||||
return "缓存";
|
||||
default:
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
return "未知";
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user