1

General question, when do people access their DAL in a prism application?

That is to say, if a module requires data do you query the DAL on the module load (I've currently been using OnImportsSatisfiedandINavigationAware.OnNavigatedTo` (passing in a parameter from the previous view).

Obviously I wouldn't want different modules to be tightly coupled but for an example where I have multiple views in a module would it be better from the UI responsiveness point of view to retrieve the data up front and pass it into the new view?

Anyone got any thoughts on this that they could share? Thanks.

obaylis
  • 2,904
  • 4
  • 39
  • 66

1 Answers1

1

In my current project we build the application this way that all view models asynchronouls query their data from one wcf service proxy after their own initialization. The proxy itself queries them from the server and caches it internally. Thus you have to think about a caching strategy.

But this leads to the following behaviour: The user interface is build up by the region manager. At the beginning it is empty. After a short time the data arrives from the server, the view models get their model, read the data from it, the data context of the view (which is the view model) is filled up and so the view is populated.

The answer to your question is: The view model queries the DAL (in my case the wcf service proxy) after it's creation in asynchronous way.

PVitt
  • 11,500
  • 5
  • 51
  • 85