如果我有以下的文本框:
If I have the following TextBox:
<TextBox Height="30" Width="300" Margin="10" Text="{Binding IntProperty,
NotifyOnValidationError=True}" Validation.Error="ContentPresenter_Error">
</TextBox>
在codebehind中,代码如下:
private void ContentPresenter_Error(object sender, ValidationErrorEventArgs e) {
MessageBox.Show(e.Error.ErrorContent.ToString());
}
如果我在文本框中输入字母"x",弹出的消息是:
无法转换值'x'
有没有一种方法可以自定义这个消息?