Welcome to MSDN Blogs Sign in | Join | Help

Syndication

IoC on Silverlight

A number of IoC containers have Silverlight versions - Ninject and Unity especially seem to have healthy Silverlight offerings. Silverlight 2.0 is a variant of the .NET runtime, so this isn't too surprising.

Thanks to Tyson Stolarski and Rinat Abdullin, Autofac recently joined their ranks with a Silverlight-compatible build. (This one is hot off the press, so test it thoroughly before you set out to build anything mission-critical :))

MEF hasn't released any concrete plans for Silverlight, but experimenters can probably coerce the Codeplex source into a compatible build by hacking the .csproj file.

If you're reading this blog and use IoC on Silverlight in one form or another:

  • What have your experiences been like?
  • Do you use IoC in the UI, the 'back-end' or both?
  • Does loose coupling/runtime composition get in the way of XAML-based designers?

I'd love to hear your thoughts!

Published Sunday, January 04, 2009 5:48 PM by niblumha

Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: IoC on Silverlight @ Sunday, January 04, 2009 1:45 PM

If you're interested in what was required to get Autofac to build on Silverlight, Rinat has kindly written about the experience here: http://rabdullin.com/journal/2009/1/4/how-to-target-multiple-net-frameworks.html

niblumha

# re: IoC on Silverlight @ Sunday, January 11, 2009 5:41 AM

I've been using Ninject all over the applications, ViewModels, Views, Services, Models, etc... I think it's a great tool. I mainly followed the example of Jonas (http://jonas.follesoe.no/YouCardRevisitedImplementingDependencyInjectionInSilverlight.aspx) with some custom tweaks.

It's great that we can provide a good design time experience. Also for testing purposes we have been able to easily mock dependencies.

Miguel Madero

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
Page view tracker