New Posts New Posts RSS Feed: Is there any event that EntityManager raises on Validation Completed?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Is there any event that EntityManager raises on Validation Completed?

 Post Reply Post Reply
Author
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Topic: Is there any event that EntityManager raises on Validation Completed?
    Posted: 31-Oct-2011 at 8:26am
I'm working on creating user control to display DevForce Verification results on my silverlight views.
DevForce supports INotifyDataErrorInfo and it works great to display errors that associated with certain fields. This part works great.
 
It doesn't work when I have form-level validation (entity level) and it doesn't work when I have validation level set to anything but error.
 
Solution is to create my own control to display all results but I need some kind of hook so I know when errors change..
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 31-Oct-2011 at 6:59pm
Hi katit;

Back to Top
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Posted: 01-Nov-2011 at 11:09am
Denis,
 
I look at it but not sure how I integrate it. Do you have code sample?
 
I use Repositories to abstract EntityManager and data from my ViewModels. Ideally, I'd like to have repositories to raise event for me so I can use it in my VM. So, I need to know when specific instance of EntityManager does validation.
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 01-Nov-2011 at 6:55pm
Hi katit;


I'm taking an existing SL Validation code sample and adding a simple BatchInterceptor to it. Hopefully it can illustrate to you what it does. You can think of the BatchInterceptor as an event that is raised each time a validation (property level or entity level) is executed.

Basically what the sample does is load all employees and their respective orders onto a data grid. As soon as the employees are fetched, I'm calling 

_mgr.VerifierEngine.Execute(_employees[0]);

to execute an entity level validation on the first employee. Put your breakpoint under MyBatchInterceptor to see how the event is raised for each of the property's validation that gets executed.

Hope this helps.
Back to Top
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Posted: 01-Nov-2011 at 8:57pm
Thanks! Looks good, Should work for me
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down