I am converting the extisting WPF 4 project in our company to Prism and I have come across a big challenge. I wonder if you may help me with that.
Within the App.xaml a Service is instantiated and initialized. This takes up to 2 min. At the same time a Splashscreen is shown on a different thread.
Once the Service is loaded an Event is raised that starts the Shell on a different thread.
I need to create an instance of this Service as a singleton within IoC, so that whenever I need the service I would get the same instance.
Theoretically thats easy to so. However I won't be able to do this in App.xaml, since I have no access to the Container yet. So I need to do this later within the Bootstrapper.
But once the Bootstrapper is instantiated and running, it would execute the method InitializeShell(), which in turn starts off the Shell.
But the Shell needs the Service to be injected in its ViewModel and the Service is not even ready yet. I need to make this method wait until the Service is successfully registered as a singleton within the ConfigureContainer() method, and only then once
the Service's OnCompleted has been raised it should execute the InitializeShell() method.
How do I achieve this? :)
Many Thanks for your advice,