开发者

Data Annotations Silverlight

开发者 https://www.devze.com 2023-01-12 15:23 出处:网络
I have a webservice that supplies data (Publisher Object) to a silverlight project. I want to bind the Publisher to a dataform and have the dataform handle to validation.

I have a webservice that supplies data (Publisher Object) to a silverlight project.

I want to bind the Publisher to a dataform and have the dataform handle to validation.

I would like to achive this by using DataAnnotations.

M开发者_如何学运维y question is.. Can I or how do you amend the Publisher object (Generated by the webservice) to add the DataAnnotations

Thanks Sp


Markup whatever class that you bind to the DataForm.

If this is a WCF web service and you bind the DataContract class objects to your DataForm, you can add the data annotations to your DataContract class members which are already annotated with [DataMember](Publisher object in your case). If you use the DataContract classes only as DTOs then markup the richer class on the Silverlight side.

0

精彩评论

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