原因:目标数据类型与绑定源数据类型不一致
解决:自己实现IValueConverter,在convert()和ConvertBack (),编写转换代码
示例:
[ValueConversion(typeof(DateTime), typeof(String))]
public class DateConverter : IValueConverter{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
DateTime date = (DateTime)value;
return date.ToShortDateString();
}
public object Conve