【发布时间】:2013-04-17 13:32:51
【问题描述】:
我正在通过后面的代码调用 IValueConverter 类,但我不确定在 Type targetType 参数中放入什么。该对象是string,但使用它会给我'无效的表达式术语'字符串'`
我调用转换器的代码
secondConverter.Convert(score, string, null, CultureInfo.CurrentCulture);
转换器类
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
TimeSpan ts = new TimeSpan(0, 0, (int)value);
return String.Format("{0:D2}:{1:D2}:{2:D2}",
ts.Hours,
ts.Minutes,
ts.Seconds);
}
【问题讨论】:
标签: c# types windows-phone-8 ivalueconverter