0

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

2 Answers 2

1

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!

0

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

1
  • My problem is that the ViewModel does not contain properties for binding to specific items; it isnt my entity. It has a collection of entities I bind to. The individual entity is defined in the OData service proxy. When creating a new item, I update a property "WorkingCopy" of my entity type on the ViewModel. If they click OK, I add the working copy to the collection & persist the changes. Therefore, implementing INotifyDataErrorInfo on the VM does not raise the validation/notification events. What I need is a way to implement this interface on the entity (the proxy), but can't figure out how. Commented Dec 8, 2010 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.