Hi Paul, I am interested in your Validation Framework, can you tell how can I get it, for testing purpose. ;)
Thanks & Regards, Muhammad Niaz Software Engineer Intagleo Systems Pvt Ltd <http://www.intagleo.co.uk> www.intagleo.co.uk From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Stovell Sent: Thursday, October 30, 2008 4:26 AM To: listserver@ozSilverlight.com Subject: Re: [OzSilverlight] Silverlight Validation Framework Hi Dimaz, I've been working on a release of a validation control for both WPF and Silverlight. I wanted to build something that was more flexible than the out of the box solution for WPF. Here's where it's headed: * Validation providers Instead of forcing one model, you can implement an interface to create your own "validation provider". Out of the box I wanted to support UI-level rules (like WPF's ValidationRule) as well as IDataErrorInfo and the Enterprise Library Validation Application Block. If you have your own needs, you can just implement an interface. * Validation triggers In WPF, validation is coupled to a binding, and in general validation takes place when the target of the binding changes. In WPF, ValidationRules kick in only after you've made a change to the UI control. IDataErrorInfo kicks in as soon as the form loads. It's difficult to control both, and you can't for example, make it pend all validation until the user hits "save". In my control you can select from: validate automatically, validate only after a control has had focus, or validate only after some sort of explicit event (when they hit "save"), and it works for all providers. * Validation targets In WPF, validation is coupled to a particular binding, which makes it hard to show the error elsewhere - for example, drawing a border not just around the input control, but also around the label, or perhaps around a pair of controls. In my control, you use an attached dependency property to indicate "this control is interested in these errors", and they get shown on that control instead. * Validation visualizations An attached dependency property is set on your object, and if you specify an "InvalidTemplate" for your control, in WPF it will create an adorner to show your template, exactly like the inbuilt system in WPF. In Silverlight, because there is no adorner, it will switch your template to an "Invalid" version of your control template. However, if you want to do something really different, you can implement an interface to visualize errors differently. * Extended error information Sometimes a message isn't good enough. You might like to provide a Help link, or a localization identifier, or an extended message, or a custom icon, or the idea of categories (error, warning, information, etc.). The validation control makes no assumptions, so if you implement your own IValidationProvider, you can raise custom validation error objects. * Summaries In WPF validation, you can't easily get a summary of all errors on a Window. In my control, you can simply bind to a collection exposed by the validation control, and visualize the errors any way you like. You could create a template to visualize the error as a hyperlink, which when clicked sets focus to the invalid control. All of the above are actually done. What's stopping me from releasing it is: * I want to implement validation rollups, i.e., on a TabControl you might want each tab heading to indicate how many errors there are on each tab. * I want to demonstrate how validation can be done async. I'm pretty sure it can, I just haven't had time to prove it. * I want to do a little more testing. If you'd like to beta test it for me, let me know :) Paul On Thu, Oct 30, 2008 at 9:25 AM, Dimaz Pramudya <[EMAIL PROTECTED]> wrote: Hi all, Do you know any good framework for doing control validation in Silverlight? Thanks. Regards, Dimaz Pramudya ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net ------------------------------------------------------------------- OzSilverlight.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by www.readify.net