Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A retrieved event
Message
De
05/03/2010 15:39:36
 
 
À
04/03/2010 07:56:54
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
VistaDB
Application:
Desktop
Divers
Thread ID:
01452442
Message ID:
01452864
Vues:
32
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform