XML and WeakEventMessageBroker

5 views
Skip to first unread message

elisgugu

unread,
May 8, 2012, 3:14:09 AM5/8/12
to ninject
Hello,
I am newbie in Ninject and IoC and I want to understand how to use it
properly.
I need to use XML configuration for creating my objects (this is a
requirement) and I done that. But I need to use WeakEventMessageBorker
too. So when create objects by the code (not with XML config file) the
events are wired together and everything works perfect. When create
objects and load XML file the events are not wired.
My xml file looks like basic.xml from the Ninject.Extension.Xml.Test
project:

<module name="basicTest">
<bind name="myObject"
service="MyNamespace.IService, MyProjectName"
to="MyNamespace.MyService, MyProjectName" />
</module>

, and class form code behind

public override void Load()
{
Bind<IService>().To<MyService>();
}

So what is the difference from both object created by xml config file
and from code behind?
I know that Ninject`s goal is to restrict using of xml, but is there
any chance to use Ninject.Extension.Xml and WeakEventMessageBorker
together?
Thanks in advance
Reply all
Reply to author
Forward
0 new messages