I have registered this with Autofac:
builder.Register(c => ViewerFactory.CreateDefault()).SingleInstance();
I’m not sure, but I think that Autofac only calls “ViewerFactory.CreateDefault()” the first time a call to resolve this service is made. Am I correct?
If I am, how can I prevent the “lazy resolution” from happening, only for this service? This will make the UI more responsive the first time this service is required, albeit at the cost of a slight increase in start-up time.
You should be able to use
That will create the instance immediately and register it, rather than creating it on first use.