Print Page | Close Window

Global Entity Manager

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1178
Printed Date: 16-Apr-2025 at 1:47pm


Topic: Global Entity Manager
Posted By: DocScooter
Subject: Global Entity Manager
Date Posted: 31-Mar-2009 at 7:35am
In the classic DF, I was able to create the equivilent of the EntityManager, the PersistanceManager in such a way using that I could use it with multiple forms and everything would be in sync.  Is that a possibility with Silverlight and if so how?
 
Thanks
Scott 



Replies:
Posted By: smi-mark
Date Posted: 31-Mar-2009 at 8:46am
Yes, put it in the App.xaml.cs/vb

private DomainModelEntityManager manager;

public DomainModelEntityManager Manager
{
        get { return manager; }
}

    Private mManager As DomainModelEntityManager
    Public ReadOnly Property Manager() As DomainModelEntityManager
        Get
            Return mManager
        End Get
    End Property

In the Application_Startup event make sure you set manager to something.


In your project you can then do something like this:

 ((App)App.Current).Manager;
TryCast(App.Current, App).Manager


Posted By: DocScooter
Date Posted: 31-Mar-2009 at 8:51am
Sweet!  Thanks alot!



Print Page | Close Window