开发者

Are there any common techniques for validating form data on the view within a Windows Phone 7 Silverlight applications?

开发者 https://www.devze.com 2023-01-13 06:21 出处:网络
I am working on a W开发者_如何转开发indows 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

I am working on a W开发者_如何转开发indows 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.


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....

0

精彩评论

暂无评论...
验证码 换一张
取 消