New Posts New Posts RSS Feed: DevForce EF and WPF
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DevForce EF and WPF

 Post Reply Post Reply
Author
Amy View Drop Down
Newbie
Newbie


Joined: 09-Dec-2008
Posts: 9
Post Options Post Options   Quote Amy Quote  Post ReplyReply Direct Link To This Post Topic: DevForce EF and WPF
    Posted: 23-Dec-2008 at 8:39pm
Hi there,
 
I am trying theDevForce EF and WPF. The ListBox Control of WPF needs to bind to a collection.  Does DevFoce EF help me to generate the collections? For example, I have table called OrderType and want to show everything in that table, the DevForce EF will generate OrderType class for me, but I can't bind it to the Listbox since it is not a collection. Do I have to get the collection on my own? Is any simple way to do it? Any WPF example with DevForce EF would be helpful.
 
Thanks in advance!
 
Amy
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 24-Dec-2008 at 6:18pm
Originally posted by Amy

Hi there,
 
I am trying theDevForce EF and WPF. The ListBox Control of WPF needs to bind to a collection.  Does DevFoce EF help me to generate the collections? For example, I have table called OrderType and want to show everything in that table, the DevForce EF will generate OrderType class for me, but I can't bind it to the Listbox since it is not a collection. Do I have to get the collection on my own? Is any simple way to do it? Any WPF example with DevForce EF would be helpful.
 
Thanks in advance!
 
Amy
 
 
A LINQ query against a DevForce EF EntityManager can be passed directly into the constructor of pretty much any list type.  Generally speaking, you should use a .NET ObservableCollection<T> if you going to do WPF data binding against the list:

   ObservableCollection<Employee> emps = new ObservableCollection < Employee >(_mgr.Employees);

If you're going to do Winform data binding, use a DevForce IdeaBlade.Util.BindableList<T>:
 
   BindableList<Employee> emps = new BindableList< Employee >(_mgr.Employees);
 
For non-data-binding uses, you can use the lighter-weight List<T>
 
   List<Employee> emps = new List< Employee >(_mgr.Employees);
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down