4.5 Does the framework automatically run rules for child lists or is OnChildChanged needed

4.5 Does the framework automatically run rules for child lists or is OnChildChanged needed

Old forum URL: forums.lhotka.net/forums/t/12386.aspx


swegele posted on Tuesday, February 18, 2014

I have a simple business rule that watches a child businesslistbase and checks if .Count > 0

Do I have to manually call that rule in the OnChildChanged override...or does that happen automatically because I point at the corresponding propertyinfo in the AddRule(myListPropertyInfo as core.PropertyInfo)?

Cheers,

Sean

JonnyBee replied on Tuesday, February 18, 2014

HI,

You must trigger the rule in OnChildChanged. 

swegele replied on Tuesday, February 18, 2014

I am using private backing fields for the child collections...they are marked with <NonSerialized(), NotUndoable()> to keep them from being saved in BeginEdits.

In 3.8 those collections had to be marked with WithEvents because I detected changes in the ListChanged event.  Now that I am detected changes in OnChildChanged I assume I can get rid of the WithEvents now?

Thanks man!

Copyright (c) Marimer LLC