Derik Whittaker

Syndication

News


Ninject.Extensions.Conventions ported to work w/ WP7

I have been using Ninject on WP7 now for a few months and I am just now getting around to porting the conventions library (this allows you to NOT have to manually bind all your classes but rather use a convention based approach).  The port of this was pretty simple and can allow you to remove many, many lines of PITA code.

**** Please note, i have NOT put this through ALL of the paces so it is possible only the simple paths work now ****

To use the convention based approach all you need to do is use the code below

IKernel kernel = new StandardKernel();
kernel.Scan(
    x =>
        {
            x.From( new List {Assembly.GetCallingAssembly(), Assembly.GetExecutingAssembly()} );                    
            x.BindWithDefaultConventions();                    
    } );

To get this to work in your project you will need to reference the Ninject.Extensions.Conventions.WP7 assembly.  I have posted the assemblies here and the code here (for now, will push to github this week)

Hope this helps other WP7’ers

Till next time,


Posted 09-04-2010 9:37 AM by Derik Whittaker
Filed under: , ,

[Advertisement]

Comments

Caleb Jenkins wrote re: Ninject.Extensions.Conventions ported to work w/ WP7
on 09-24-2010 1:34 AM

Derik - how has the perf been running ninject apps on an actual WP7 device? Perf has been my major concern about bringing some of my favorite tools over to WP7 (like ninject)

thanks,

Derik Whittaker wrote re: Ninject.Extensions.Conventions ported to work w/ WP7
on 09-24-2010 5:21 AM

@Caleb,

I really have not seen any issues w/ perf when using these tools to be honest.  And I have a real device to test on as well as the emulator.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)