我可以将工作从对象转换为文本框。但是我在转换时有点茫然。非常感谢任何线索或帮助。
[ValueConversion(typeof(Object), typeof(String))]
public class DataConverter : IValueConverter
{
// This converts the DateTime object to the string to display.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
BasePar data = (BasePar)value;
return data.ToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
string strValue = value as string;
Object objString = (Object)strValue;
return objString;
}
}