开发者

Adding IDataErrorInfo (or validation) to custom OData service (w/o WCF RIA Services) + MVVM

I'm not using WCF RIA Services... I've 开发者_开发知识库got a custom OData service that my SL4 application is using. I need to add validation to my forms. I notice the proxy that VS2010 creates does not implement IDataErrorInfo on the entities. I'm tyring to add it to my view model, but the validation isn't being recognized by my SL app.

Is it possible to add validation like this? Surprised I haven't been able to find more results on this in my searches... :(


Figured it out (can't believe this didn't occur to me). The proxy generated by VS2010 for the OData service generates partial classes. All I had to do was create a new partial class & implement INotifyDataErrorInfo.

Thanks for the interface pointer Einarsson!


Have your ViewModel implement INotifyDataErrorInfo and it should be working. :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜