I have the following projects/assemblies in my solution:
- Entities; It is a class library that contains two classes:
Account
andAccountDetail
.Account
class has a property Details which is of typeObservableCollection<AccountDetail>
and I use it to store the details of the account object. - Core; It is a class library that contains one class:
AccountController
whose purpose is to get the data from the Sql Server and to populate theAccount
objects (alongside the AccountDetail collection within them). - Gui; It is a WPF Application project that contains one WPF Form called:
AccountsWindow
whose purpose is to present the list of all accounts retrieved from the Sql Server - Gui.Controller; It is a class library that contains one class:
AccountWindowController
which is supposed to be the "bridge" between theAccountController
from theCore
assembly and theAccountsWindow
from theGui
assembly and to assist with the data binding. (I am not sure whether I need this assembly at all.)
Here's what I wish to do:
I want to get all accounts from the Sql Server using the AccountController
class from the Core
assembly and to put them in some list. Then, I want to data bind a list box in AccountWindow
with that list of accounts.
My questions:
- Where should I placed that list of accounts, in the
AccountWindowController
or somewhere else? - Should that list be of a type
ObservableCollection
? - Do I need that list of accounts at all?
- When data binding, should I create a
Window.Resource
from theGui.Controller
orEntities
classes?
I know this is a lot of text to read, but my questions are really simple as I am a newbie with the WPF and any help would be greatly appreciated. Thanks!
Update: My agony is continued here. Cheers!