Tuesday 28 June 2011

Validation in Windows Presentation Foundation

Paul Stovell has a great article on the WPF error validation model at http://www.codeproject.com/KB/WPF/wpfvalidation.aspx.

The validation model in WPF is robust and tied in with Bindings, Using it in Powershell would be a matter of:
  • Implementing a C#/VB.net class as a wrapper to System.Management.Automation.Scriptblock to override the Validate() method.
  • Programmatically set the validationrules property binding of the binding to include an instantiation of the new class.