I am making a Prism desktop application and intend to use WCF services to populate list boxes etc within views within my modules.
I have read the guide from cover to cover and have set up my solution so that I have:-
1) Shell project
2) Infrastructure Project
3) Module1
4) Module2
In Module1 I have a viewmodel that contains an ObservableCollection Customers populated by calling a WCF service directly within the view model.
I don't feel this is correct and I want to follow the Prism best practice for referencing the WCF service. The reference implementations don't really seem to be helping me in this regard.
My first attempt has been to create an interface IWCFCustomersAdapter in the Infrastructure project and have this forward on calls to the WCF service client. It is implemented in the Infrastructure project. The service reference is also added in to the Infrastructure project. Each module has a reference to the Infrastructure project and uses the datatypes defined in the WCF service.
What are the other / best choices in this circumstance? Could the interface still go in the Infrastructure project and the service references and implementation go in the modules? What are the pros and cons of the different choices?
Any tips and advice most appreciated.
Thanks
Alex