views:

51

answers:

1

I am working on a Windows Phone 7 application and I'd like to know if there are any common ways to implement validation on the form. Some simple examples would be really helpful. I'd love to see something that uses data annotations, but I don't believe that's supported in Silverlight 3 (and thus WP7). To be clear, I'm looking for things like, required field, max length, etc.

A: 

From what I can see WP7 Siverlight does not support DataAnnotations (which is how I do my OOB SL4 apps) and the Validationstates for the textbox control do not seem to work. I check the exception in my Set action and throw an error. You could then handle the event (and display feedback to the user) but it seems as though this is not supported in the shipped features - very strange!

If you enter bad data it just seems to ignore it completely....

Rodney