I am facing the following scenario:
My application contains a lot of information (stored in classes), the user can search the information for specific words (similar to the file search in Windows).
Once the user hit the search button, the search should begin asynchronously and collect results in the background. The search process can take a long time. Let's say the class which handles the searching is called SearchService (SearchService.cs).
The user can open a results view while the search service is working which contains a datagrid of results that is required to be updated as more results are found.
So basically:
Service is collecting information asynchronously -> View Model should get the already existing results and should be notified of new results -> View with datagrid should be updated asynchronously
How should I implement this? Let's say the View Model exposes an ObservableCollection to the view, but how should that collection be updated from the service?
I am using Prism and MEF.