Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Though in simple situations, Catel will resolve and inject all types automatically, there are a few exceptions to the rule. On One of these exceptions are extension methods. These are static classes which can be used to add functionality to an object. The downside is that you cannot use dependency injection in static classes, and each object that is extended can have their own scoping of dependency resolvers. To solve this issue, Catel introduces the DependencyResolverManager. This is a manager that keeps track of all types and objects and the DependencyResolver that were used to create the object. This way it is still possible to retrieve additional dependencies in extensions methods in the same dependency resolver the type was created with.

...