Wednesday, May 29, 2013

N=24 - a SplitViewPresenter - N+1 Days of MvvmCross

As a first step in talking about custom presenters, I created N=24 - a splitview sample.

This sample shows how to create a presenter which allows the same Views and ViewModels to be used in different ways on the iPhone and iPad:

The video is at:

A slide deck for custom presenters is:

The code is on:

If you want to see more N+1 videos, then please see the full and fabulous index on

Tuesday, May 28, 2013

N=23 - Dialogs - N+1 Days of MvvmCross

Sorry for the lack of new videos...

Just a bit busy right now - including with some time off :)

Today's video covers the MonoDroid and MonoTouch Dialogs in the 3.0.7 nuget MvvmCross packages

I may have been a little bla in my intoduction today - I may have assumed that everyone knows what dialogs are already....

If the mention of Dialog makes you think 'what's a Dialog?' then it might be best to start with an introduction to Dialogs... so maybe start with Nic Wise's slides at:


(video of his talk is also coming soon on

If, however, you are already familiar with Dialogs, then here's the MvvmCross action:

And the code is on:

A full and fabulous index for N+1 is on

Previously in N+1:

Thursday, May 23, 2013

N=22 - From basics on the Mac (N+1 Days of MvvmCross)

Today's screencast is in response to a question on StackOverflow -

This possibly isn't as long-term a fixture in the N+1 collection as the other videos... but it shows how you can use MvvmCross on the Mac for both iOS and Android if you want to.

The current Xamarin PCL situation is changing... so I very much hope this video will be out of date very soon indeed!

The source is on:

A full and fabulous index for N+1 is on

Previously in N+1:

Wednesday, May 22, 2013

Preserving data during Xamarin.Android debugging - e.g. keeping your SQL and your settings files

Great advice from

To preserve data and cache data between application installs:

In Visual Studio:

  • Click Tools > Options...
  • In the left-hand tree, select Xamarin > Android Settings
  • In the right-hand panel, select [X] Preserve application data/cache on device between deploys.

In Xamarin Studio:

  • Click Tools > Options (Windows) or Xamarin Studio > Preferences (OS X)
  • In the left-hand tree, select Projects > Android
  • In the right-hand panel, select [X] Preserve data/cache between application deploys.

Based on the post on Xamarin Forum

N=21 - Internationalisation - i18n - N+1 days of MvvmCross

Today I talk through an introduction about how to provide some localised text to your UI.

The code for today is at:

The slides are on:

Today I tried a slightly different style - I tried slides and a pre-built demo. Let me know what you think of this style - is it useful? Better? Worse? Different?

Coming up soon.... more on custom controls, and then time for custom presenters too - tabs, panoramas, hamburger-slideout-views, etc...

A full and fabulous index for N+1 is on

Previously in N+1:

Listen to just the N+1 bits you need - Absolutely Awesome Aboo

I know many of you are now seeking professional help after listening to parts of the N+1 series.

If only there had been an index available... if only someone had listened to all the videos and put an index in place...

This work of *awesomeness* is the work of just one man - Aboo - @azarnoush - please go to Twitter and thank him!

This index is awesome!

Thank you, Aboo - index-maker and badge-of-awesomeness-owner. Thank you.

Using PP files to make nuget packages more consumable - @dsplaisted hits **4**

Over the last five months of handing out MvvmCross Badges of Awesomeness, only three have been awesome enough to hit 3 badges....

And one of them, @dsplaisted, today hits 4!

Previously in 'The evolution of Dan'

Daniel's been a great supporter of the project and he's previously contributed awesome things like:

And recently, he's made another awesome contribution - this issue which pointed out how to use .pp source code transformations in nuget in order to make MvvmCross project start even simpler.

This has had a big impact - especially when combined with @Cheesebaron's res-auto change. Thanks to these changes, starting a WindowsPhone, WindowsStore, Android or iOS is now really simple.

This is awesome.... and so Daniel...  it's an absolute pleasure to award you badge number 4

Awesome Internationalisation - Thank you Opendix from all the languages (including LolCat)

Your apps should speak to your users in their own language

Within MvvmCross, we've included a JSON-based system to help with this -

But what if you want to use old-school resx files - which can benefit from all the existing Microsoft tooling and addons like rdio's Vernacular?

Well... the awesome news is that the latest Xamarin code along with 'Swiss'-Opendix Stefan have a solution for you -

This is awesome!

Stefan aka Opendix - thank you - a pleasure to award you a first MvvmCross Badge of Awesomeness!



Thanks also to for helping me bring this post to you in 2 languages. Who needs Google Translate...

Awesome-F# + Awesome-Xamarin.iOS + Awesome-JMGomez

I have to admit.... I don't really understand what I'm talking about here.... But just look at the beauty:

It's awesome ... and I reckon it might be what the future looks like :)

If you want to learn more:

Juan M Gomez - @_jmgomez_ - thanks hugely for pulling us closer towards the f#uture - I'm so looking forwards to using this. I can sense the hoverboards getting closer! Badge of awesomeness #2

Triple Cheese - res-auto makes Android resource coding ten times easier

The awesome @CheeseBaron bags a third badge of awesomeness for helping out the project with this line of magic xml:


This simple res-auto change has made a big difference to MvvmCross Android resource coding - it's awesome!

If you do Xamarin.Android coding and you don't already follow CheeseBaron's blog and GitHub account, then you're missing out on some fab control action...

@CheeseBaron - MvvmCross salutes and thanks you for a third time - triple-awesome-cheese:

The first MvvmCross Ninja Belt of Awesomeness - NinjaCoderForMvvmCross - Adrian Sudbury

I don't need to say anything else about this contribution.

It's awesome

Ninja-Adrian - @asudbury - we salute you!

Now a double-badge awardee (with a special yellow-ninja belt added in):

For more on this VisualStudio plugin....




Monday, May 20, 2013

N=20 - Custom Controls on WindowsPhone - N+1 Days of MvvmCross

Of all the platforms, WindowsPhone is the one I probably know best... However, as I found out recording N=20, there are still gaps in my knowledge here :)

This talk follows on from N=18 and N=19 - we add the same some custom label and 'custom draw' shape controls as we added for iOS and Android. "Modern Windows" seems to be a bit unusual in this area - it's less about draw onto a Graphics Context and more about using a pre-built Canvas. And I clearly am not a DependencyProperty fan :)

I may have gotten some thing wrong during this recording - for more expert Windows advice... check out

The video:

The code:

Previously in N+1:

N=19 - Custom Controls on iOS - N+1 days of MvvmCross

Following on from N=18, I implemented the same 2 Custom Controls in iOS:

  • a subclassed UILabel
  • a custom drawn UIView

The video is:

The code is:

Previously in N+1:

N=18 - Android Custom Controls (N+1 Days of MvvmCross)

Today's short video shows two techniques for implementing custom controls in Android.

  • The first is `SubClassing` - which implements a control by inheriting from an existing one.
  • The second is `Custom Draw` - inheriting from View and then overriding the Draw method.

The video is:

The code is at:

There's also a short slide show in custom controls at:

Previously in N+1:

Friday, May 17, 2013

N=17 - From WP and Android to Touch (N+1 days of MvvmCross)

Finally... after a gap of a week we're back.

Sorry about the delay - it's mainly due to the fabulous training day we did on Monday in London, coupled with quite a lot of time that I've spent on customer projects.

Today's N+1 is about porting to iPhone:

  • Takes the Collect-A-Bull app from N=16
  • Briefly recaps over the WindowsPhone and Android functionality (apologies for some recording glitches here)
  • Adds a new iPhone project
  • Adds the plugins to it
  • Switches to the Mac where we add some views using XIBs (and we hit a 'freeze' within Mac OSX too!)
  • Switches back to the PC where we add the data-bindings for those views
  • Finishes with some debugging

I possibly rushed this step a little too much... I also possibly added some lines about ValueConverters that I didn't need to - adding some confusion - sorry!

Overall, though, I hope this is useful and I hope it brings Collect-A-Bull to a reasonable conclusion :)

Here's the video:

The source is on:

An N+1 index:

Previously in N+1:

Wednesday, May 15, 2013

MvvmCross Stickers in the wild

The stickers are out there....  please tweet or send me your pics!

An index for the N+1 Videos

Just received this tweet

Fab :) Thanks :)

Tuesday, May 14, 2013

The other speaker's slides from yesterday...

Slides and links from London MvvmCross event

Here are the notes from yesterday's MvvmCross sessions in London.

I'll be back on N+1 soon


How Can We Help?
Riaz Ahmed, Nokia,, @TheRealRiaz
Mike Taulty, Microsoft,, @mtaulty

Links to resources and events:

If you would like to get funding (up to 70k euro!) for developing a Windows Phone app, then head over to AppCampus ( and apply!

So that's it from us! If you need to get in touch, our contact details are above.
Happy coding! 
Riaz and Mike
MvvmCross Basics
@GitteTitter blogs at

Slides available at

Staying SOLID with PCL
Vagif Abilov @ooobject
Slide Deck -

Helping the Lions Roar
@JonStoneman and Stephen Dunford from @SequenceAgency
Slide deck -

MvvmCross slides:
Some slides:
The Welcome:
Using SQLite-net:
Custom Controls:
iOS User Interface options:
Solving linker problems:

For more technical details on MvvmCross, follow the N+1 series of videos on YouTube:

Friday, May 10, 2013

N=16 - Taking Collect-A-Bull from WindowsPhone to Xamarin.Android (N+1 days of MvvmCross)

Today we took the output of N=15 and ported it to Android

Before we started, we upgraded our projects to the latest MvvmCross packages - on NuGet with version 3.0.6

Once we started on Droid, it was mainly a case of converting Xaml to Axml, but we did hit a few tricky points along the way - especially around Images and Location - we'll come back to look at some of these in N=17.

The video is at:

The source is at:

Previously in N+1:

N=15 - Adding a Details Page to Collect-A-Bull (N+1 Days of MvvmCross)

In this sample we continue on developing within only WindowsPhone...

We create a way to show the details of a CollectedItem from the ListView.

In the Xaml, we use ugly code behind - sorry, but I messed up my Xaml behavior!

We add a DetailsViewModel and DetailView, using some new ValueConverters along the way.

We also extend our Collection service in order to allow items to be deleted - responding to a DeleteCommand.

Here's the video:

The source is at:

Previously in N+1:

Thursday, May 09, 2013

'Ninja Coder for MvvmCross’ AddIn for Visual Studio - Testers needed

zOMG - I just received this email....

Hi Stuart,

I have just released my first version of my ‘Ninja Coder for MvvmCross’ AddIn for Visual Studio.

The ‘Add Projects’ should work apart from a small problem with references in the windows store project!!!
The ‘Add ViewModel/Views’ is still work in progress – but should just about work.
The ‘Add Converters’ is still something I’m playing with – I’m not sure if it will stack up but let’s see (may not work!)

I wanted to release it as I keep tweaking it and not pushing it out.

I have struggled creating an MSI (and spent a lot of time on it!) – I had to do it by hand – I’m quite a wiz on WIX now J - I’ve installed it on 3 machines and it appears ok! – hopefully will work for you.

Hopefully you will find useful.

The MSI I have put in the gallery and can be downloaded from here

I tried to write a few words about the AddIn here (to be honest I put a lot more effort into the code – there wasn’t enough hours in the day and the code took precedent!)



Xamarin Studio - quick run through for iPhone with MvvmCross and Xamarin.iOS (MonoTouch)

You will no doubt have noticed that almost all my work at the moment is in Visual Studio

There are three main reasons for this:

  1. I work with WindowsPhone and WindowsStore and these need Visual Studio
  2. Resharper owns me
  3. The Portable Class Library support in Xamarin Studio fails very often

Don't get me wrong - I love the work that Xamarin did last year (before XS) in making MonoDevelop better - the Intellisense really transformed at some point during 2012. However, right now, it's just not a platform I can do my everyday work on. And I need to work in order to eat :)

However, if you are Mac bound and you want to play with MvvmCross, then I've made this short demo video for you - 10 minutes to a working app.

The source code I wrote is:

The MvvmCross binaries used are downloaded from:

All binaries are built against Xamarin stable products - but I do know others who have built binaries from using the Alpha products - but I can't help you there :)

If you want to do a Droid version, then do a similar app - just use the Droid folder instead of the Touch one - and look in for inspiration :)

Hope that helps :)

N=14 - Adding the PictureChooser and File plugins to CollectABull - N+1 Days of MvvmCross

Continuing on the Collect-A-Bull sample, we add:

  • Image taking using the MvxPictureChooserTask
  • File read/write using the MvxFileStore
  • On-View image display using some value converters

The source code from the end of this step is at

I may have been a bit confusing when I talked about the value converters - sorry about this. The basic concept that I was trying to explain was:

  • the WindowsPhone Image control directly supports BitmapImage objects for its Source property
  • the WindowsPhone runtime knows how to load http:// urls and embedded app content/resource files into BitmapImage objects
  • but it does not know what to do with either byte[] arrays or with isolated storage file paths
  • to work around this problem, we provide two converters to do the work


Previously in N+1:

N=13 - A couple of small Collect-A-Bull improvements - N+1 Days of MvvmCross

Just a small step to start today

We take the current N=12 code and fix a couple of small problems:
  • one to do with location 
  • one to do with messaging/update of the Home page

The finished code is at:

Previously in N+1:

Wednesday, May 08, 2013

N=12 - Collect-A-Bull - A full app - part 1 (N+1 days of MvvmCross)

In this N+1 we start on a bigger app - a Collect-A-Bull app

This app will include functionality to:

  • capture items in a collection
  • add location and a photo to these items
  • view the list of collected items
  • edit and delete items
  • and share items too

Technically this will ultimately combine:
  • Multiple pages 
  • Multiple platforms
  • SQLite
  • Messenger
  • Location
  • Images
  • Sharing
  • And maybe more...

This first step - which is PCL and WindowsPhone only - is captured in full at:

The code for this first step is at:

More will follow tomorrow....

Previously in N+1:

N=11 - CollectionView (N+1 Days of MvvmCross)

Today I took a quick look at replacing the tableview in N=3: Kitten Cells on iPhone (N+1 days of MvvmCross... with an iOS6 CollectionView:

As ever, I hit a couple of snags along the way - sorry - sometimes I get carried away with my live coding :)

The source for this is

If anyone does want to try using the 'roulette layout' then it's at:

The excellent Xamarin intro doc is at: - there's also a great Xaminar somewhere - check out

Next up in N+1, I really will start on a bigger multi-step sample :)

Previously in N+1:

Tuesday, May 07, 2013

Schedule and details for May 13th London - HotTuna day!

I've posted the proposed schedule and some setup notes for May 13th to SkyDrive:

Looking forwards to seeing a few of you there :)

N=10 - SQLite Persistent Data Storage - N+1 Days of MvvmCross

Today I looked at some simple SQLite operations using the MvvmCross SQLite plugin which is built on top of Frank's excellent SQLite-net ORM

As this was mainly about the PCL code, I only demo'd in Xamarin.Android and WindowsPhone.

The code from the demo is available in:

During the demo, there was some oddness with the keyboard on the emulator - sorry!

Previously in N+1:

Friday, May 03, 2013

N=9 - Getting the Message (N+1 Days of MvvmCross)

Following on from N=8, I decided to refactor the Location sample so that it used the Messenger plugin.

I don't think this was the best of demos... but we will come back and use the Mvvmcross Messenger a **lot** in future samples - - so I'll try to explain it again better then :)

The code is in:

Previously in N+1: