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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-24-Split



If you want to see more N+1 videos, then please see the full and fabulous index on http://mvvmcross.wordpress.com/

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:

- http://fastchicken.co.nz/2013/04/20/xamarin-evolve-talk-fast-ui-creation-with-monotouch-dot-dialog/

(video of his talk is also coming soon on http://xamarin.com/evolve/2013)



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






And the code is on: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-23-Dlg




A full and fabulous index for N+1 is on http://mvvmcross.wordpress.com/


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 - http://stackoverflow.com/questions/16703828/mvvm-cross-support-for-xamarin-studio-on-a-mac


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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-22-AndroidDemo


A full and fabulous index for N+1 is on http://mvvmcross.wordpress.com/


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 http://stackoverflow.com/questions/16695739/doesnt-create-save-database

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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-21-Babel


The slides are on: https://speakerdeck.com/cirrious/internationalization-in-mvvmcross






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 http://mvvmcross.wordpress.com/


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
UR APPS SHUD SP33K 2 UR USRS IN TH3R OWN LANG


Within MvvmCross, we've included a JSON-based system to help with this - https://speakerdeck.com/cirrious/internationalization-in-mvvmcross
WIDDN MVMCRS, WIV INCLUDD JSN-BASD SIS-TM 2 HALP WIF DIS - https://speakerdeck.com/cirrious/internationalization-in-mvvmcross


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?
BUT WUT IF U WANTS 2 USE OLD-SKOOL RESX FILEZ - WHICH CAN BENEFIT FRUM ALL TEH EXISTIN MICROSOFT TOOLIN AN ADDONS LIEK RDIOS VERNACULAR?


Well... the awesome news is that the latest Xamarin code along with 'Swiss'-Opendix Stefan have a solution for you - http://opendix.blogspot.ch/2013/05/using-resx-files-for-localization-in.html
WELL... TEH AWSUM NEWS IZ DAT TEH LATEST XAMRIN CODE WIF SWIS-OPENDIX STFN HAZ SOLUSHUN 4 U -  http://opendix.blogspot.ch/2013/05/using-resx-files-for-localization-in.html

This is awesome!
DIS AR TEH AWSUM!


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


STFN-OPNDX - FANK U - PLESUR 2 AWAD U 1ST MVVMCROS BADGE OV AWESOMENES!


....

Thanks also to http://speaklolcat.com 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:


    xmlns:local="http://schemas.android.com/apk/res-auto"
 


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....

Download: http://visualstudiogallery.msdn.microsoft.com/618b51f0-6de8-4f85-95ce-a50c658c7767

Source: https://github.com/asudbury/NinjaCoderForMvvmCross/

Blogs:

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 http://www.geekchamp.com/




The video:





The code: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-20-CustomControls3



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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-19-CustomControls2



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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-18-CustomControls


There's also a short slide show in custom controls at: https://speakerdeck.com/cirrious/custom-controls-in-mvvmcross


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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-17-CollectABull-Part6



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

Stuart





How Can We Help?
Riaz Ahmed, Nokia, riaz.ahmed@nokia.com, @TheRealRiaz
Mike Taulty, Microsoft, mtaulty@microsoft.com, @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 (http://appcampus.fi) and apply!


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

Slides available at http://slidesha.re/10Liozh


Staying SOLID with PCL
Vagif Abilov @ooobject
Slide Deck - http://bit.ly/102x0c0


Helping the Lions Roar
@JonStoneman and Stephen Dunford from @SequenceAgency
Slide deck - http://slidesha.re/13YE7Cw

MvvmCross slides:
Some slides:
The Welcome: http://bit.ly/10Vhavp
Data-Binding: http://bit.ly/ZXOXFh
Using SQLite-net: http://bit.ly/10w1Y7Y
Collect-A-Bull: http://bit.ly/14jXeXb
Custom Controls: http://bit.ly/10w2B1n
Internationalization: http://bit.ly/18Ib2y4
iOS User Interface options: http://bit.ly/12xmx6Z
Solving linker problems: http://bit.ly/18Ibqgg


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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-16-CollectABull-Part5



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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-15-CollectABull-Part4



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

http://visualstudiogallery.msdn.microsoft.com/618b51f0-6de8-4f85-95ce-a50c658c7767

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!)

http://adriansudbury.blogspot.co.uk/2013/05/ninja-coders-for-mvvmcross-part-1.html

http://adriansudbury.blogspot.co.uk/2013/05/ninja-coders-for-mvvmcross-part-2.html

Thanks

 zOMG zOMG zOMG!

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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/Z-%20MacOnly/MyApp



The MvvmCross binaries used are downloaded from: https://github.com/slodge/MvvmCross-Binaries/




All binaries are built against Xamarin stable products - but I do know others who have built binaries from https://github.com/slodge/MvvmCross 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 https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-00-FirstDemo 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 https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-14-CollectABull-Part3



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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-13-CollectABull-Part2




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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-12-CollectABull


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 https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-11-KittenView_Collections



If anyone does want to try using the 'roulette layout' then it's at: https://github.com/slodge/RotatingCollectionView



The excellent Xamarin intro doc is at: http://docs.xamarin.com/guides/ios/user_interface/introduction_to_collection_views - there's also a great Xaminar somewhere - check out http://dotnetmobilepodcast.blogspot.co.uk



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: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-10-KittensDb








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




Previously in N+1: