Thursday, 9 May 2013

Ninja Coders for MvvmCross Part 1


This blog post is in the wrong order - what should come before this one about MvvmCross and the work Stuart Lodge has done.

Stuart's work with MvvmCross is excellent - it’s hard to imagine one person doing the work he has done - I know he has had help along the way - and I am a holder of an MvvmCross badge of awesomeness to prove it! - but he is the main developer and driving force behind it.

In a nutshell MvvmCross allows C# developers to use their Mvvm skills across multiple platforms hence the name.

More on MvvmCross in another blog post.

This rant is about the work I'm doing to try and utilise my current love of code generation/automation techniques and MvvmCross.

Stuart with help from another has managed to implement Nuget packages to create the bare bones projects to support MvvmCross development.

This is a huge step in the right direction but I feel I can add a little more to make it slightly easier to get up and running with MvvmCross - the problem with the Nuget approach alone it still leaves a few manual tasks that in an ideal world would be automated - and this is where 'Ninja Coders for MvvmCross' steps up to the plate.

So what am I baffling on about?

This will be an ongoing process of trying to make MvvmCross development easier via automation.

The first part is to create the project templates - these will be:-

  • MvvmCross.Core
  • MvvmCross.Core.Tests
  • MvvmCross.iOS
  • MvvmCross.Droid
  • MvvmCross.WindowsPhone
  • MvvmCross.Wpf
  • MvvmCross.WindowsStore

Hopefully the names explain themselves!

I did try to integrate the project templates directly with the Nuget MvvmCross packages but after failing miserably and wasting lots of time I gave up that approach. 

What I then decided to do was what I would have done had the Nuget packages for MvvmCross not been created, which was to create a 'Lib' directory, adding in all the assemblies to be referenced into this folder. This approach means that when I export the project to a template this folder and its contents are exported making the references still valid.

I may revisit the Project Template/Nuget issue at some point - but at the moment I'm favouring keeping the templates as they are as it just seems a little neater and more controlled which also make it simpler to version and source control. Just my opinion!

That is enough talking for now I need to get back the code and finishing off the templates.


  1. Hi, for some reason, after I install NinjaCoder for MvvmCross no project templates appeared and Add Projects function doesn't work. What can I do to fix. VS 2012

    1. Same. No templates. Very confused. 2013.

    2. This comment has been removed by the author.

  2. Hi,
    I have installed this plugin. Later while building code targeting windows phone 8 , getting The name 'FastApplicationSwitchingService' does not exist in the current context error.

    1. a few people have reported this - just comment that line of code out and see if it works.

    2. Then the app itself is not launching. (dont know whether not launching of app is related to commenting out of that line or not)