InjectionMethod

Topics: CAB & Smart Client Software Factory
Feb 3, 2006 at 10:02 AM
originally posted by: samkuehn

I have been unable to find any documentation on using the InjectionMethod attribute. How do you call it?
Say I have a base presenter with a Initialize method like this?

InjectionMethod
public void Initailize
(
ServiceDependency WorkItem workItem,
ServiceDependency IUserServiceAgent userServiceAgent,
)
{
m_WorkItem = workItem;
m_UserServiceAgent = userServiceAgent;
}

I don't understand the point of injection if you have to supply values so how do you call this method so that DI injects the values? XXXX.Invoke(method)?

Thanks in advance.
Feb 7, 2006 at 4:11 PM
originally posted by: BradWilsonMSFT

Anything marked with InjectionMethod is called by the dependency injection framework when the object is created. You don't call it yourself; the DI framework will automatically call it for you.