WPF Data Binding and Validation Rules Best Practices

Mark Heath picture Mark Heath · Sep 15, 2008 · Viewed 118.2k times · Source

I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote any space to this issue. I see that you can create custom ValidationRules, but I am wondering if this would be overkill for my needs.

So my question is this: is there a good sample application or article somewhere that demonstrates best practice for validating user input in WPF?

Answer

rudigrobler picture rudigrobler · Sep 15, 2008

I think the new preferred way might be to use IDataErrorInfo

Read more here