Files
6098/Cowain.Bake.BLL/Converter/ProcessParamIdConvertor.cs

33 lines
856 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
using Prism.Ioc;
namespace Cowain.Bake.BLL.Converter
{
public class ProcessParamIdConvertor : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is int val)
{
var p = MyAppContainer.Current.Resolve<MemoryDataProvider>().GetProcessParam(val);
if (null == p)
{
return "";
}
else
{
return p.ProcessParamName;
}
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return 0;
}
}
}