Silverlight validation

how to validate input form of silverlight control? I have 3 controls, two of the three are text boxes (for name and age) and the remaining control is a date picker.

When I click the submit button, validation should be activated. how will it be done?

early.

+2


source to share


3 answers


If you are using Silverlight 3, check Data Validation. http://www.silverlightshow.net/items/Data-Validation-in-Silverlight-3.aspx



If you are using Silverlight 2, you will need to copy your own code for validation.

+2


source


I wrote my own validation for SL2. It is based on:



  • Bound property to give the user an individual control validation ID
  • Business object validators that identify invalid data
  • VisualTreeHelper to parse visual tree and compliance check result and custom check id
  • Custom templates for controls to display validation
  • INotifyPropertyChanged to remove the validation display if the property value has changed.
0


source


You can also find the Validator Application Block (which is part of the Silverlight Enterprise Library Integration Pack ). This is currently a public viewing.

0


source







All Articles