Monday, May 20, 2013

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:


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 - http://nuget.org/packages/MvvmCross.HotTuna.Plugin.Messenger/ - so I'll try to explain it again better then :)



The code is in: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-09-Location%20And%20Message




Previously in N+1:

N=8 - Location, Location, Location (N+1 days of MvvmCross)

Today's N+1 is about how to use the MvvmCross Location plugin - https://www.nuget.org/packages/MvvmCross.HotTuna.Plugin.Location/



I go 'quite quickly' through a 4 platform demo - taking 20 minutes to build a simple app to display your current Lat and Lng on the screen.



The steps are very simple:

  • we create a 'normal' MvvmCross app with PCL core and platform specific UIs
  • we add the Location plugin to all projects
  • we start a Watcher from the Location plugin in our ViewModel
  • we use a Watcher callback to update Lat and Lng properties in our ViewModel
  • we bind to Lat and Lng within each of the UIs



While running we do hit a few (sim)emulator limitations though - not all the emulators allow you to easily get or set the current location of the device.



Here's the action:






The source code for this sample is uploaded to: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-08-Location



In a real app, I'd never really put location directly into a ViewModel like that - I'd more likely use a singleton to host the location watcher and then use Messages to distribute the location throughout the app - guess I should N+1 about that soon too...



If anyone wants to take this any of the N+1 samples further - e.g. if you'd like to produce a screencast which adds some maps too - then please do - I'll happily tweet and blog about it to promote them :)




Previously in N+1:


Thursday, May 02, 2013

N=7 - adding some refinements to Books (N+1 days of MvvmCross)

Today, I thought I'd try adding some finesse to yesterday's Books sample.


It didn't entirely go to plan... I did hit some bugs along the way.


However, overall I got there in the end :)


Among the things this N+1 shows are:

  • Adding some System.Threading.Timer functionality to the ViewModel - to provide dampening to the network query rate (during typing)
  • Adding an IsLoading indicator to the ViewModel - so that I could show an IsLoading UI indicator (e.g. a spinner)
  • Adding and using the Visibility plugin
  • Adding a custom InverseBool ValueConverter
  • A quick intro to adb - the Android Debug Bridge
  • Adding the coding4fun NuGet package to help change WindowsPhone TextBox behaviour
  • Fighting with Xamarin.iOS to get it to update the executable in the simulator
  • Fixing bugs in lock(object) - sorry - should have spotted this bug quicker!



For this video to make sense, you may need to first watch the videos from:





The code for today is at:  https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-07-BooksPlus



This code in GtiHub also includes the UI updates for the WindowsStore sample too - I didn't do these during the video as I'd already talked too long... Most of the WindowsStore changes use the same techniques as I used in WindowsPhone. The only exception was that in order to get real time updates from the textbox I had to pull in http://weblogs.asp.net/broux/archive/2012/07/03/windows-8-update-textbox-s-binding-on-textchanged.aspx - this also required lots of Reactive NuGet packages too.



The video is at:





That's all for now :)


If you've got special requests for future N+1's then let me know! Or if you want to contribute your own...



Previously in N+1:

Wednesday, May 01, 2013

N=6 - Books over the network (N+1 days of MvvmCross)

Today we make another 4 platform example.

This time:
  • we include a very simple REST service - which sends GET requests to the Google Books search API
  • we include the JSON plugin to decode the requests
  • we try to use the Visual Designers to help produce nicer UIs

You'll quickly spot that I'm not very good with the designers - it's not them, it's me :)


Here's the video:





You'll see that I hit a couple of errors along the way:
  • I initially got my namespace wrong - sorry - just had to fix it during the demo!
  • A bug in  the JSON plugin NuGet package for MvvmCross - have already fixed in v3 (but not uploaded to nuget.org yet)
  • A possible bug in Mono (MonoTouch?) with SSL - will report to Xamarin and see what they say


Completed code is on: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-06-Books



For more on the Google Books API try https://developers.google.com/books/docs/v1/using#PerformingSearch


For more on json to C# conversion, see http://json2csharp.com/

.... or try http://blogs.msdn.com/b/webdev/archive/2012/12/18/paste-json-as-classes-in-asp-net-and-web-tools-2012-2-rc.aspx



Update: I then moved across to the Mac and did a prettier cell design - here it is:






Previously in N+1:

Tuesday, April 30, 2013

N=5: Some first ICommands and multiple page (N+1 days of MvvmCross)

Back in action after some Xamarin Activation gremlins, I've recorded a new N+1 :)

This sample shows:
  • some fab new features which make the 3.0.5 nuget packages even easier to use
  • how to add ICommand's to ViewModel's
  • how to bind ICommand's to Buttons in WinRT, WP, Droid and Touch
  • how to add multiple view models
  • how to add multiple views in WinRT, WP, Droid and Touch
  • how to navigate between views/view models

The finished code is in: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-05-MultiPage


The video of the action is:




Wasn't quite up to my normal speed today - sorry, will type quicker but will talk slower again next time :)

Now we're up and running, if you have any other feedback or requests, please put them on comments here or on Xamarin forums.

If you have technical questions, then StackOverflow please :)

It's good to be back!


Previously in N+1:

Section Binding in MvvmCross's MonoTouch.Dialog - Awesomeness from Alexey

Last month Alexey published some extensions to our MvvmCross vNext Dialog port which allow Dialog Sections to be dynamically bound to collections.

This enables you to load (and bind) your sections direct from ObservableCollections - which is awesome.

The code is on https://github.com/asednev/MvvmCross.AlexeysExtensions - complete with:
  • a really good Readme.md showing how to use the new BindableSection generic element.
  • a full sample too

This is awesome - and earns Alexey a huge badge of awesomeness! Thanks Alexey!


A guest post in N+1 - totally awesome - thank you TheBearF8 - awesome

As some of you know, my N+1 series on MvvmCross is mainly Visual Studio based so far....

This has left a few of the Mac-based Xamarias lost... sorry

However, into this void stepped a hero called Barry - also known as TheBearF8 - and he recorded his first ever screencast - a one-shot demo showing you to reproduce the n=0 in just Xamarin Studio without NuGet.





This is simply awesome - helping MvvmCross out heaps - thank you Barry the Bear - a badge of awesomeness well earned and truly deserved:


Portable wrappers for Siaqodb - awesome work from RickDuarte!

A couple of weeks back I saw a tweet from about a PCL wrapper for their database.

It seems a @RickDuarte has been busily generating this wrapper and has open sourced it on GitHub for everyone to use.

This is especially fab for any MvvmCross users



This is truly awesome - and well deserving for a Badge Of Awesomeness - the first one to go to Brazil!

Obriagdo @RickDuarte!



Strong assembly names - JonStelly - awesome!

I got a request last week for strong assembly names in MvvmCross.

I've got to admit my heart sank a bit...

I wasn't too keen on the idea...

It sounded like boring dull work to do....

But then the requester - Jon Stelly - took the time to explain to me why it was such a good idea - because it enabled MvvmCross to be used in ClickOnce deployed applications.

And then ... even better yet.... he just started doing it - sending me a pull request for the first 2 assemblies.

There's still plenty more that could be done in this area - but at least we're on the road towards being ClickOnce-deployable now

Jon Stelly - thank you for the education and for the pull - awesome:




Saturday, April 27, 2013

A pause in N+1

Sorry about the pause in N+1 recordings

The problem is that Xamarin Activation problems have hit my PC.

I've not changed any of my licenses, they haven't expired, but the Xamarin activation code decided it didn't want me to do any more work.

I hope to be back coding again soon. N+1 will continue

Stuart

Friday, April 26, 2013

Auto resource namespace resolution for Android XML

Oh yes! Oh yes! Oh yes!


The mighty @CheeseBaron has just pointed out to me that you can use this syntax in your Android XML in order to automatically include the local namespace:
 
  xmlns:local="http://schemas.android.com/apk/res-auto"
 
Tried it in Xamarin.Android and it seems to work :)

So, you no longer need to use the old syntax like:

  xmlns:local="http://schemas.android.com/apk/com.my.package.name"

This little hint is going to remove yet another one of those little editing annoyances - thanks, CB :)

Wednesday, April 24, 2013

Adding Kittens to Blend's design time data

I love Kittens - especially PlaceKitten :)

To support PlaceKitten inside the Blend Visual Studio designer I edited the SampleStrings.csv files in:

  • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Blend\SampleDataResources\en\Data
  • C:\Program Files (x86)\Microsoft Expression\Blend 4\SampleDataResources\en\Data


To each of these files I added a new column "Kittens" and in that new column I added entries like: http://placekitten.com/301/301


Then, after restarting Blend I can use Kittens in sample data - like:



If you are desparate for kittens, my complete file is:



N=4: ValueConverters (N+1 days of MvvmCross)

This N+1 video is about ValueConverters


This video moves 'quite fast' - I'm assuming now that I don't have to explain how we create basic apps - if you find this too fast, then please return to the earlier videos :)


In this video we:
  • Create a simple ViewModel which has one text property, Foo
  • Create a number of ValueConverters to convert to/from the Foo string
  • Rush through the creation of sample apps on all 4 platforms which use those ValueConverters

The video is:






I like ValueConverters and I use them a lot:
  • Partly this is because they really help when it comes when converting from cross-platform data types (like MvxColor and MvxVisibility) to platform specific equivalents
  • And partly this is because I use them for validation/control visual effects - e.g for enabling/disabling controls while async network calls are occurring


However, not everyone likes them and I have a lot of respect for the opinions of those who don't like them... If you would like some in-depth background to some of the contentious issues about ValueConverters then check out: http://programmers.stackexchange.com/questions/114090/are-value-converters-more-trouble-than-theyre-worth



I think next on N+1 (tomorrow) I will start to look at some Plugins.


If you've got any feedback on this series - or anything you'd like to see covered, then please get in touch.


Previously in N+1:

N=3: Kitten Cells on iPhone (N+1 days of MvvmCross)

This video recording was a bit of a disaster - sorry!


I think I hit every technical gremlin possible during this recording...


But still I managed to get this done inside 30 minutes - so I hope this video is useful to you :)


I also hope you don't mind me posting this 'as is' - I obviously could have removed the mistakes/problems or I could have re-recorded this session - but I thought seeing the problems would be heplful to you.

----


With that explanation out of the way....


The flow I tried to demonstrate was:

  • Switch yesterday's N+2 solution across to the Mac
  • Load the solution inside Xamarin Studio
  • Change the configuration of the solution so that it correctly worked for the 'iPhone Simulator' configuration
  • Use the Add->New wizard to add a new 'iPhone Table Cell'
  • Use the xCode XIB editor to change the Table Cell layout
  • Use the xCode Assistant editor to link the UI controls in the layout to 'Outlets' 
  • Save in xCode and return to Xamarin Studio
  • Let the automation in Xamarin Studio create C# properties from the 'Outlets'
  • Use the code editor to change the UITableViewCell to an MvxTableViewCell
  • Use the code editor to add some Data-Bindings for the cell
  • Use a special MvxImageViewLoader to load the image from the Internet
  • Run the app


During the demo I hit several gremlins and made a couple of mistakes myself - but I hope you can learn from these. If nothing else, you can learn not to trust everything I say :)




The video is:






Previously in N+1:




Next up... maybe some value converters


Please do let me know if these N+1 demos are useful, if you'd like to see these recorded slightly differently, if you'd like a topic covered, if you'd like to record a session or if you have anything at all to say :)


Stuart

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:

N=1: TipCalc - a second example - adding IoC and the Xamarin Android Designer (N+1 days of MvvmCross)

Following on from yesterday's first app, today we build a Tip Calculation app for WindowsPhone, Xamarin.Android, WindowsStore and Xamarin.iOS


This walkthrough provides a second example of using the MvvmCross Nuget packages to create a new app.


It repeats many of the steps from yesterday, but also adds:
  • the use of IoC to create a Service and to automatically inject that Service into the ViewModel constructor
  • the use of Slider (Windows), UISlider (iOS), and SeekBar (Android) in databinding
  • some simple use of the Android designer to create a UI - you'll quickly see that I'm not a power user of this designer :)

The code is up on:

To use this code, users will need to:


The video is:





Sorry about the indecision between int's and double's at 4 minutes in :) Not feeling very decisive this morning!


For a longer (and slightly-out-of-date) TipCalc tutorial, try http://www.codeproject.com/Articles/566191/MvvmCross-v3-Writing-a-First-App



Previously in N+1:

My current PCL setup in Visual Studio for the Xamarin twins

To get PCLs working for the Xamarin Twins (MonoTouch and Mono for Android) in Visual Studio - the only current changes I make are these two files which I add to:


C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks




If you have previous files added - especially for VSMonoTouch - then please remove these .xml files as they may cause issues.

Following Evolve, we *hope* that these additional files won't be needed soon - hopefully in the next 4 to 8 weeks. Please bare with us - the best cakes take time to bake :)

Monday, April 22, 2013

N=0 : A first MvvmCross Application (N+1 days of MvvmCross)

As the first step in N+1 days of MvvmCross, here's a first video.



In it, we make a core library containing the App and our first ViewModel:
  1. We create a first PCL Core library
  2. We add MvvmCross Hot Tuna StarterPack using NuGet
  3. We change the namespace on the App and ViewModel
  4. We add some more logic to the ViewModel - just a simple FirstName, LastName property pair with a calculated FullName
Then, we add a Windows Store UI:
  1. We create a WindowsStore UI project
  2. We add a reference to the PCL Core
  3. We add MvvmCross Hot Tuna StarterPack using NuGet
  4. We change the namespace on the generated Setup
  5. We make some small changes to the default App.xaml,cs file
  6. We then add a Views folder and a FirstView
  7. This adds a Common/LayoutAwarePage - which we edit a little to turn it into an MvxStorePage
  8. We can then add some Databound TextBlock's and TextBox'es to the XAML
  9. We can then hit F5 to run the app
Then we add a Droid UI:
  1. We create a Xamarin.Android UI project
  2. We add a reference to the PCL Core
  3. We add MvvmCross Hot Tuna StarterPack using NuGet
  4. We change the namespace on the generated Setup, SplashScreen and FirstView classes
  5. We edit the FirstView AXML file to include the correct local XML namespace
  6. We can then add some Databound EditText's and TextView's to the AXML
  7. We can then hit F5 to run the app - this takes a little time because I hadn't set up the emulator beforehand - sorry!
 Then we add a WindowsPhone UI:
  1. We create a WindowsPhone UI project
  2. We add a reference to the PCL Core
  3. We add MvvmCross Hot Tuna StarterPack using NuGet
  4. We change the namespace on the generated Setup
  5. We make some small changes to the default App.xaml.cs file
  6. We then add a Views folder and a FirstView
  7. We then need to change the inheritance on this FirstView in both the XAML and in the C# - so that the View inherits from MvxPhonePage
  8. We can then add some Databound TextBlock's and TextBox'es to the XAML
  9. We can then hit F5 to run the app

 Then we add an iPhone UI:
  1. We create a Xamarin.iOS iPhone HelloWorld UI project
  2. We add a reference to the PCL Core
  3. We add MvvmCross Hot Tuna StarterPack using NuGet
  4. We change the namespace on the generated Setup file
  5. We make some small changes to the default AppDelegate.cs file
  6. We then add a Views folder and a FirstView - using the iPhone UIViewController template
  7. We then change the inheritance on this FirstView so that the View inherits from MvxViewController instead of UIViewController
  8. To create the UI within Visual Studio, we can then add some Databound UITextField's and UILabel's using some simple code (we will use a designer in a later exercise)
  9. We can then hit F5 to run the app - using TeamViewer to connect to a remote Mac
  10. This causes some problems - which we mainly fix by tweaking the 'set as startup project' settings, and by setting the ApplicationName, Identifier and Version for the iPhone app.
The finished code is in https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-00-FirstDemo

To get this working, users will need to:

Please feel free to let me know what you think of this type of tutorial - if you like these, then I'll see if I can make one of these every day - and I'm happy for others to add their tutorials too :)

My pre-Evolve talk

In the lead up to Evolve, I gave a talk at the London WindowsStore developer group

The camera work is a bit 'zoom happy' and the talk is actually quite different to the one I gave in Texas - but here it is for those of you who are interested:

Sunday, April 21, 2013

Evolve - sphero action

Last week at Evolve was awesome - simply awesome

I hope to blog more about that in the coming week (or weeks!)

But in the meantime, here's the video of my 5am jetlag-inspired action with 7 spheros




:)

Thursday, April 11, 2013

v3 Beta continues.... with a small breaking change...

I've recently pushed a small change to the source tree which broke a lot of code...

The central "Container" class, Mvx, has moved from `Cirrious.CrossCore.IoC` to `Cirrious.CrossCore`

The reason for this was because I also added some Exception and Trace helpers to that `Mvx` class - it's started to become MvvmCross's `$` helper.

Sorry about breaking code - but you'll be glad to see that the quantity of this type of change is very, very much reduced now - v3 is most definitely in Beta :)

Thanks for reading

Stuart

Wednesday, April 10, 2013

MvvmCross Technical Day in London

Finally we have a date and a venue:

Modern Jago in East London
Monday May 13th 2013

I've put a sign-up page live on http://mvvmcross.eventbrite.com/

Currently the plan is to have a full day of in-depth talks about MvvmCross, about real-life Mvvm cross-platform projects, and about C# and Mvvm deployed using both Microsoft and Xamarin products, and to then provide a separate room where people can get some hands-on coding time if they want to.

Thanks hugely to Microsoft UK for providing such an excellent venue.

The event is free. But please only sign up if you really intend to come - space is limited.

If anyone wants to talk at the event - whether in a 'expert' role, or about an app you've developed, or about something else - then please contact me - me@slodge.com

This is a free event, but if anyone wants to assist with sponsoring:

- food and drink
- event video recording
- speaker travel costs

then please again get in touch - me@slodge.com