开发者

problem with validationsummary and view model implementing INotifyDataErrorInfo

I guess my question is how the heck does validationsummary determine what its going to show?

I have a view model implementing INotifyDataErrorInfo and some validation errors get shown in my validati开发者_JAVA百科onsummary whereas others do not and I can't see what the difference is.

Also, how can I get object level errors to show up? For object level errors, do I use null string.empty or something different?

update

The 2 properties that will not show up in the validationsummary are observablecollection.

Still not solved.


Make sure that your ValidatesOnNotifyDataErrors=True,NotifyOnValidationError=True,etc are on the correct property.

I had a similar problem once where I wasn't getting an error to show up where I expected, because those properties were set in the binding statement of SelectedItem and not ItemsSource. Also, the ValidationSummary will use SelectedItem property's bound property to identify to the user the Title of the property that an error occurred on, regardless of which property you are actually validating. So make sure that you put a Display attribute on that property to make things look nice for the user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜