Composite WPF and Ninject

38 views
Skip to first unread message

Michael Hart

unread,
Jul 1, 2008, 5:11:26 AM7/1/08
to nin...@googlegroups.com
Hi all,

I've had some success replacing Unity with Ninject in the latest 2008
RC1 drop of Composite WPF (http://www.codeplex.com/CompositeWPF),
which I've attached as a zipped solution. You'll just need to add
Microsoft.Practices.Composite.dll,
Microsoft.Practices.Composite.Wpf.dll and Ninject.Core.dll to the Lib
directory.

It works for the basic HelloWorld case (just extend
NinjectBootstrapper instead of UnityBootstrapper) and should work for
any projects you create from scratch.

It's a little trickier with some of the other samples, such as
StockTraderRI because the Composite WPF team have chosen to pass the
DI container into the module and controller constructors, which makes
it a little messy - there's a thread about that here: http://www.codeplex.com/CompositeWPF/Thread/View.aspx?ThreadId=30567

I've chosen not to globally bind IKernel, again because it doesn't
quite feel right (to me at least - I'm happy to be persuaded
otherwise), but this may be something you could consider adding.

Also, it's basically a line-for-line copy of the UnityExtensions code
and so there are various techniques which aren't necessarily what I
would think are best practice for Ninject (or even Unity, but that's
another matter).

Let me know if you have any success with it and I'll add it to ninject-
contrib if anyone wants it to live on.

Cheers,

Michael

NinjectExtensions.zip

Nate Kohari

unread,
Jul 5, 2008, 9:56:19 AM7/5/08
to nin...@googlegroups.com
Michael:

Yet another cool extension, thanks!


-Nate

Michael Hart

unread,
Jul 9, 2008, 11:39:18 PM7/9/08
to nin...@googlegroups.com
Nate: No worries - I just added this to ninject-contrib too.

I figured it probably didn't live under the existing WPF project as it
targets quite a different framework/platform. However, I'm quite happy
for you/anyone to move it wherever you like.

Cheers,

Michael

On 05/07/2008, at 11:56 PM, Nate Kohari wrote:

> Michael:
>
> Yet another cool extension, thanks!
>
>
> -Nate
>

> On Tue, Jul 1, 2008 at 5:11 AM, Michael Hart <michael...@gmail.com

Reply all
Reply to author
Forward
0 new messages