比如我想将一个int字段前面加“记录” ,我修改人家的源码就要用到一个类,但是数据是千变万化的,不可能转换一个小东东就要写一个类吧,有什么办法可以带参数去转换的,程序根据我传过来的参数从而返回不同的数据~~
public class Strconvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ("记录:"+value.ToString());
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new System.NotImplementedException();
}
}