Back to list
Views:   8.4K
Replies:  0

Silverlight 4 DataForm and INotifyDataErrorInfo


I've spent some time testing and extending functionality of 'Silverlight Patterns 4.0 solution'.
I've been mainly struggling with populating validation errors on DataForm after raising ErrorsChanged event (INotifyDataErrorInfo interface).

Can you please give some suggestion or an example how to implement INotifyDataErrorInfo (in Silverlight) over DataForm with:
 - direct exposing Model to the View (CurrentCustomer property in your example) or
 - wrapping each Model property by ModelView property and exposing it to the View
and after raising ErrorsChanged event to display the validation error on DataForm?

 In the 'Silverlight Patterns 4.0 solution'  there is CustomerViewModel.CurrentCustomer property directly bound to the DataForm as CurrentItem of DataGridCustomers. The CurrentCustomer is directly exposing Customer model. In case we edit Customer details and after failed details validation how to display error on DataForm?
 During debugging after raising ErrorsChanged event I can see that the INotifyDataErrorInfo.GetErrors("CurrentCustomer") has been called by the external code (I suppose it is coming from DataForm as event subscriber) but there is no any error indication on DataForm.

Havlas Jozef, Nov 04, 2010
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.