public delegate void EntityListChangedDelegate;Then in the ABusinessObject class of my business project I added an event:
public event EntityListChangedDelegate EntityListChanged();
and overrided the OnStateChange Method addingode to fire the event when retrieved:if (bizState == mmBusinessState.Retrieved) { if (EntityListChanged != null) { this.EntityListChanged(); } }Now in my WPF Window I added to the constructor, after registering the object:
this.bizObj.EntityListChanged += new EntityListChangedDelegate(bizObj_EntityListChanged);Then in the method created I added the code for setting the ItemsSource of the grids:
this.dataGrid.ItemsSource = this.BizObj.EntityList;Now I don´t need to keep track where and when an object has perform a GetEntity or GetEntityList, the grid is updated automatically. I only need to set the grid´s ItemsSource for childs when a new entity has created for a parent bizObj.