What controls are you using? DataForm and DataGrid respect the INotifyDataErrorInfo interface described below (and implemented by DevForce-generated Entities), and should respond automatically. I'm not sure about the state of other Silverlight controls - please check Microsoft docs.
Verification in the Silverlight UI
System.ComponentModel.INotifyDataErrorInfo
is a Silverlight-only interface that defines members that data entity classes
can implement to provide custom, asynchonous validation support. Important
Silverlight user interface controls including the DataForm and DataGrid check
for the implementation of this interface by data entities to which they are
bound and provide excellent messaging in the user interface to help end users
learn about and correct validation errors.
Such Silverlight user interface controls do not depend upon
exceptions being thrown in order to learn about validation problems. Instead,
they subscribe to an ErrorChanged
event published by the entity as part of its INotifyDataErrorInfo compliance. That event is raised by the data
entity whenever it believes that a change to its state might be important to
some control in the user interface. The UI control, learning of such a change,
can then query the data entity via its INotifyDataErrorInfo.GetErrors()
method to obtain a current set of validation errors, which it may then expose
to the end user as its developer sees fit.
Because of the support for INotifyDataErrorInfo by Silverlight UI controls, most developers working
in Silverlight will want to set the system default for VerifierOptions.ErrorNotificationMode to Notify rather than any setting that results in exceptions being
thrown for validation errors.
|