I find that in WPF it is often not possible to use a DI container in the composite root only. I set up all dependencies in the root but I find the need to instantiate view models that simply cannot be instantiated in the root.
Take custom controls for example that live in tabs or get spawned in new windows. Their view models need to be instantiated by the view itself when it gets active. Many of my view models need a dialog provider which I inject as an interface into the VM constructor.
I am not using the DI container as a service locator. I am a firm believer in constructor injection but as I said I find the need for using the DI container to instantiate view models far beyond the composite root. So far I have been using a static class that hosts the DI container which I can use throughout my app.
I am just wondering how you guys have solved this issue?