2
我有一个自定义数字文本框绑定到双。 出错时,显示(作为工具提示)的默认错误消息是“无法将字符串转换为双精度”或类似的内容。如何通过wpf中的转换器设置错误消息
如何更改该自定义消息?
我试图通过转换器来做到这一点:
class MyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return 1234.23;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// if(value is not good)
// ?? throw exception ??
}
}