1

I have read in "Dependency Injection in .NET" by Mark Seemann that there should be a single place (per each) where Register, Resolve and Release have to be called. Now, I'm trying to set up the environment of a new WPF project. Our team has decided to use Caliburn.Micro as MVVM-framework with MEF as IoC. So, I clearly understand where Register has to be called, but what about Resolve? I also have read in the book, that in ASP.NET MVC app there is a place where Resolve has to be called:

override IController GetControllerInstance(RequestContext requestContext,
                                           Type controllerType) {
    return (IController)this.container.Resolve(controllerType);
}

But where should the call reside within a WPF app? Besides, can Caliburn help somehow with accomplishing this issue?

EngineerSpock
  • 2,575
  • 4
  • 35
  • 57

1 Answers1

1

But where should the call reside within a WPF app? Besides, can Caliburn help somehow with accomplishing this issue?

Actually Caliburn.Micro handles this part for you, because when you derive your bootstrapper from the existing BootstrapperBase or Bootstrapper<TRootModel>, those bootstrappers call a method called Start() that initiaties a sequence of activities which composes the entire object graph of your application starting with TRootModel or whatever you call DisplayRootViewFor(Type viewModelType) for.

Ibrahim Najjar
  • 19,178
  • 4
  • 69
  • 95