Print Page | Close Window

where to store global collection of values

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2411
Printed Date: 29-Jul-2026 at 12:18pm


Topic: where to store global collection of values
Posted By: BillG
Subject: where to store global collection of values
Date Posted: 31-Dec-2010 at 5:21am
I have a table call Controls which contains a list of controls which are in effect for  a particular client. I want to load the controls into an observable collection at the start of the app and then search the list during the running of the app to see if a particular control is set to Y or N. Where would be best place to store the collection so that it can be accessed by all view models?  In my app class?
 
Bill
 



Replies:
Posted By: sbelini
Date Posted: 05-Jan-2011 at 5:22pm

Hi Bill,

 
Ideally, it'd be better if you created a service and passed it in the constructor of the view models.
You can find an example (the Bookshelf sample application) describing the above in our http://drc.ideablade.com/xwiki/bin/view/Documentation/BookShelf - DevForce Resource Center .
 
You could also, create a static class with the controls (although I recommend you try the first suggestion).
 
Silvio.



Print Page | Close Window