Philipp Sumi creates a custom binding/markup extension with an example where he’s added a “lookup” key to the text field.
A base class for custom WPF binding markup extensions
Nigel Spencer writes some code which allows him to attribute a data class with validation rules such as maximum length. I like the style of putting some basic data rules on the data object rather than spreading the rules around the user interface.
Applying MetaData to WPF Bindings
This style would require diligence on the part of the developer and UI designer to be certain that all of the various input methods (controls) are covered, and that the markup extension is used consistently.
I’d like to see a solution which didn’t rely on a custom markup extension if possible. Maybe an attached property or something … (my style is to try to use built-in stuff as much as possible for training, learn-ability, tool support, etc).