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