Tuesday, April 23, 2013

N=2: Lists and Kittens (N+1 days of MvvmCross)

A second N+1 today - and now we're looking at extending our viewmodel and view relationship into using Lists


Each native platform has several controls for handling list display and MvvmCross tries to treat them all in the same way - for each and every platform, MvvmCross provides or uses an ItemsSource and an ItemTemplate property for data-binding.


In this sample, we quickly run through the 4 modern platforms:
  • we create a shared PCL core with a single ViewModel which contains a List
  • we add a UI for each platform
  • within each UI we use one or more templates to show the List and the ListItems
  • within the Android and iOS platforms, we also add 2 plugins - File and DownloadCache - in order to provide some Internet image download functionality

With iOS, we do leave some ListItem/cell customisation work 'TODO' - we will return to this in the near future.



Warning: this tutorial does move quite quickly - it's designed for people who have already watched one or more of the previous N+1 videos, and for people who have some knowledge of Mvvm already.


The finished source is available on: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-02-KittenView


The video:




Previously in N+1:

3 comments:

  1. Many many thanks for those tutorials and all the great work you're doing...i've finally managed to find a decent amount of time to spend on studying MvvmCross and i find it incredible! The NuGet package is a great feature, and following those videos makes all clear and easy. I think that, probably, it would be usefull to make tutorials on more "advanced" topics ( like plugin usage, file access/read, tombstoning... ). Anyway, the example code projects are truly clear and usefull.

    ReplyDelete
  2. Thank You for Tools and Tutorials!!

    ReplyDelete
  3. These videos are great, thank you! Would it be possible for you to post higher quality versions?

    ReplyDelete