Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A retrieved event
Message
From
05/03/2010 15:39:36
Antonio Llano
Inmollano S.L.
Getxo, Spain
 
 
To
04/03/2010 07:56:54
Antonio Llano
Inmollano S.L.
Getxo, Spain
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
VistaDB
Application:
Desktop
Miscellaneous
Thread ID:
01452442
Message ID:
01452864
Views:
31
Done!!!!

I have created a public delegate:
    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.
Previous
Reply
Map
View

Click here to load this message in the networking platform