I have the following projects / assemblies in my solution:
- Entities This is a class library that contains two classes:
Account and AccountDetail . Account class has a Details property, which is of type ObservableCollection<AccountDetail> , and I use it to store information about the account object. - Core This is a class library that contains one class:
AccountController , the purpose of which is to obtain data from the Sql server and populate Account objects (along with the AccountDetail collection inside them). - Gui This is a WPF application project containing one WPF form called
AccountsWindow , the purpose of which is to list all the accounts received from the Sql server - Gui.Controller ; This is a class library that contains one class:
AccountWindowController , which should be the "bridge" between the AccountController from the Core assembly and AccountsWindow from the Gui assembly and to help data binding. (I'm not sure if I need this assembly at all.)
Here is what I want to do:
I want to get all the accounts from the Sql server using the AccountController class from the Core assembly and put them in some list. Then I want to bind data to a list in AccountWindow with this list of accounts.
My questions:
- Where should I place this list of accounts in
AccountWindowController or somewhere else? - Should this list be of type
ObservableCollection ? - Do I need this list of accounts?
- When linking data, should I create
Window.Resource from Gui.Controller or Entities classes?
I know this is a lot of text to read, but my questions are very simple since I am new to WPF and any help would be greatly appreciated. Thanks!
Update: Agony continues here . Hooray!
data-binding code-organization wpf project-organization
Boris
source share