Friday, December 07, 2012

async and await were made for Sphero... and for psy #GangnamStyle

Still having fun with Sphero and C#

Today we decided to add some async/await automation... and to let Sphero dance....



Thanks to async/await, the code for dance sequence is easy - it looks like:

        private async Task Dance()
        {
            Stop();
            Color(0,0,0);
            Tail(0);
            await TailTo100Over10();
            await OneSecond();
            PulseWhiteEverySecond(6);
            Color(0,200,0);
            for (var i = 0; i < 5; i++ )
                await ZigZag();
 
            for (var i = 0; i < 3; i++)
                await Sequence1();
            for (var i = 0; i < 3; i++)
                await Sequence2();
            for (var i = 0; i < 20; i++)
            {
                await Sequence1();
                await Sequence2();
            }
        }

We also added multiple Sphero control from the same phone - will show that as soon as the video arrives :) :) :)

Thursday, December 06, 2012

Sphero Ball Control in the Marketplace

Sphero Ball Control now live in the Marketplace

Here's the link:


Here's a demo:




And here's one idea for what we might try to do next:

28 Sphero Holiday Dance: Union Square NYC from Sphero on Vimeo.

Wednesday, December 05, 2012

Announcing MvvmCross Badges of Awesomeness

A lot of people are doing awesome things with MvvmCross.

To celebrate, I'm announcing today:


MvvmCross Badges of Awesomeness




I'm keen to award these out to anyone you know has:
  • developed an awesome app using MvvmCross
  • githubbed an awesome MvvmCross extension or plugin
  • blogged an awesome bit of MvvmCross information
  • presented an awesome session on MvvmCross
  • done something else Mvvm and/or Crossie which is awesome....

I'll be awarding the first batch of badges in the next week... and I'll be posting about each and every badge award here on the blog - probably on a special page.

I'm hopeful this will help spread the word about awesome things developers can do with MvvmCross and also help customers find skilled contractors too - because we are worth it!

If you think you deserve one or more badges - or if you know someone who does - please let me know! If you think someone is awesome, then they probably are.

Tuesday, December 04, 2012

Sphero Ball Control for Windows Store apps - a nice hack but a sad story :(

I've ported the Sphero Ball Control to Windows Store

However, because Windows Store apps can't access a very full Bluetooth stack, then I had to use a desktop element (a Windows Service) to make the code work.

This means that the app can not currently be submitted to the Windows Store.

If you want to see Sphero in the Windows Store, please write to Microsoft and comment and vote on this thread/issue now:
http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/6634240b-c042-4e76-a3b0-1f1103ea0ddf

Here was the demo

Monday, December 03, 2012

How Deep Are Your Unit Tests?

This is one of my favorite StackOverflow questions and answers: http://stackoverflow.com/questions/153234/how-deep-are-your-unit-tests

Kent Beck answers:
          
I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris). If I don't typically make a kind of mistake (like setting the wrong variables in a constructor), I don't test for it. I do tend to make sense of test errors, so I'm extra careful when I have logic with complicated conditionals. When coding on a team, I modify my strategy to carefully test code that we, collectively, tend to get wrong.

Different people will have different testing strategies based on this philosophy, but that seems reasonable to me given the immature state of understanding of how tests can best fit into the inner loop of coding. Ten or twenty years from now we'll likely have a more universal theory of which tests to write, which tests not to write, and how to tell the difference. In the meantime, experimentation seems in order.


As the first comment says:

The world does not think that Kent Beck would say this! There are legions of developers dutifully pursuing 100% coverage because they think it is what Kent Beck would do! I have told many that you said, in your XP book, that you don't always adhere to Test First religiously. But I'm surprised too.

In case you don't know who Kent Beck is: http://en.wikipedia.org/wiki/Kent_Beck

Sunday, December 02, 2012

Sphero - Ball control - introduction video

Ball Control - hopefully coming soon to the Windows Phone 8 Store :)

Saturday, December 01, 2012

Sphero App submitted to Windows Phone Marketplace

I've submitted :)

My first WP8 app.

Don't know whether it will pass first time!

Below are some screenshots

Stuart

Friday, November 30, 2012

BallControl - an open source Sphero C# controller - WP7, MonoDroid and hopefully MonoTouch (and WinRT?)

Meet my latest open source project - meet BallControl for Sphero:


Here's a first video I made for the project - sorry about the low audio volume!


Xamarin the Native, Sphero the Ball and Lumia the Phone....

After a long week of coding, this experiment in sleep deprivation reaches its inevitable conclusion....

Featuring:
- Xamarin.Mobile Picture capture
- Native voice control
- Native accelerometer control
- Native UI with lots of touch
- Native BlueTooth
- Guest Starring Sphero the ball
- Cross platform Mvvm

Xamarin the Monkey....  because going Native matters

Can I sleep now?

Here's the apps first public outing to a local user group:


Some technical info

The project demonstrates Xamarin.Mobile by using Xamarin.Mobile media picker.... But, beyond that it also extends Xamarin.Mobile tackling some elements of several Xamarin.Mobile requests on uservoice:

The Source

The source is on: https://github.com/slodge/BallControl

Currently, we have:
  • a working WP8 app
  • a working (but ugly) MonoDroid app
  • a non-working Windows Store app - it seems that Windows Store does not yet support BlueTooth SPP devices - which is so bad :(
I will get a MonoTouch app working soon....

I will also post to the WP8 app store soon.

And I will post some more videos soon....

If anyone is interested in how the app was built I did live blog the first 10 hours of coding... see PDF at http://sdrv.ms/V8xdmV (or email me for a Word doc). Sorry I didn't blog the whole lot - but there was a lot of code to write... and I did it in 5 days end-to-end while still holding down the day job too.

That's AmazeBalls! How do I get a Sphero:


If you want a sphero, then try:

If you cannot open your WP7 Project in Visual Studio 2012!

For the last month I've been swearing at the Visual Studio 2102 and WP8 teams...

The reason: because when I open my WindowsPhone 7 solutions, then it shows them as "unavailable" - which makes me very very sad - because I have to use VS2010:


However, last night @dsplaisted asked me if I'd tried right-clicking on them and reloading them.

It worked

I can now open my Windows Phone 7 projects in VS2012 :)

Apparently, the problem was:
  • I first tried to open this solution before the WP8 SDK was installed
  • Visual Studio 2012 didn't know about how to open these - so it marked them 'do not open' in my solution options.
I am sooooooooooooo glad I can open all my projects in VS2012 again!

Wednesday, November 28, 2012

If you cannot see WP8 packages in nuget....

Then you need to install a newer version of nuget - http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c

I just wasted 30 minutes of my life trying to work out where the Phone Toolkit had gone and why I couldn't install it... ah well....

:)

An awesome sample - Wish List from Redth

An awesome sample of using Azure Mobile Services, Azure Web Sites, MvvmCross, ZXing.Net bar code scanning and Xamarin.Mobile too:



Source code is on https://github.com/Redth/WshLst

There might be some blogging on it at Redth.info and some tweeting from @Redth
  • if I were being critical:
    • it is currently a bit 'code heavy' in the UI layer, 
    • there are some #if things in the core code
    • the lack of portability support in Azure Mobile Services and in Xamarin.Mobile has forced it away from PCL which is a shame
  • but overall:
    • it's amazeballs - check it out!

Tuesday, November 27, 2012

A simple multitouch view for MonoDroid

I needed a multitouch view for MonoDroid (Mono for Android), so I built one :)

I based it on
http://android-er.blogspot.co.uk/2011/05/detect-multi-touch-on-custom-view.html

It seems to work quite well - to see it in action, just include it in your project and then you can use it in your axml or in your C#


The code:

Monday, November 26, 2012

MvvmCross on the TabletShow :)

Thanks to @MrLacey for this tipoff: http://www.thetabletshow.com/default.aspx?ShowNum=60

What they said (about 30 minutes in):
It's basically an Mvvm framework using the Xamarin tools. It takes it all the way up to the UI layer, so that the only thing you are building is, for example on the Windows 8 side, just the XAML; on the iOS side just the XML that describes the screens; and the same thing on the Android side.
And you're binding - that's it!
Everything else from that UI definition down is all shared code - so you're basically building almost your entire app with shared code. You're just defining the views each time.
There were plenty of "So Cool", "pretty exciting" and "Awesome" comments thrown in - and some inciteful remarks about:
  • the importance of native UI
  • how MvvmCross provides you a native UI
  • how it allows you to swap out views on each platform
  • how it helps lower the cost of native development
  • and about how MvvmCross is ideal for business apps

Thanks to John Sonmez and the Tablet Show team for the nice comments about the 'huge potential for cross-platform development' :)

Sunday, November 25, 2012

Happy 1st Birthday to MvvmCross - How hard can it be...?

It's official: MvvmCross is 1 year old this week!

The MvvmCross story started early in November 2011 when I started work on the Star Wars Kinect social app.

I had a plan to technically build that app using WindowsPhone, MonoTouch and Mono for Android, and I had a basic WindowsPhone prototype that I'd hacked together using TweetSharp and some code-behind... but, beyond that, I really didn't know what I was building or how I was going to do it.

Luckily, towards the middle of the month, MonoCross 1.0 was released. I downloaded it eagerly, and also struck up some online conversations with some of the MX guys, especially Kenny Goers who patiently and skillfully dealt with all of my queries.

Over the next week or two I talked, walked and typed through lots of code. There were lots of prototypes written, lots of emails and code exchanges back and forth, and lots and lots of time spent swearing at compilers, debuggers and phones.

I *loved* what the MonoCross guys had done in trying to put down a rigid MVC structure for their apps - in trying to provide a formal structure for sharing code cross-platform. However, I also hit a few problems with the MVC pattern itself, with the way MonoCross memory management was architected and with the static nature of the MX code base.

To try to work around these problems somewhere around the 25th November, I checked in my first Cirrious.MonoCrossExtensions commit - and Kenny and I again exchanged some emails - especially about memory management, about IoC and about charging forwards...

It was also at about this point that we had a technical meeting inside the Star Wars Kinect project... and at some point during that meeting one of myself or John McLoughlin (imaji on Twitter) said something like:
We could just go the whole way with Mvvm. How hard can it be?
That question hung there for a while....
How hard can it be....?

And so... on the 28th November I ended up abandoning Cirrious.MonoCrossExtensions and commiting the first files into Cirrious.MvvmCross

This was the first proper MvvmCross commit - 'OMG! What haz I done?' - just 280 changed files and 60,000 additions...

The rest, as they say, is history :)

Happy Birthday Mvx!

Thursday, November 22, 2012

ThanksGiving post - Thanks for more Portable Class Library/Portable Library Project solutions for MonoTouch/MonoDroid

On this day of ThanksGiving in the US....

Thanks!

I'm really grateful for some of the input I've gotten recently from Microsoft and Xamarin.

Especially:

1. Daniel Plaisted at Microsoft has just heroically supplied a detailed idiot-proof solution to the strong naming issues for ICommand, ObservableCollection, etc.

This solution is:

I think this is what you need to do to get around the type sharing / strong name signing issues for portable libraries on Mono:

-> Extract the public key of System.Windows.dll, and put it in the project directory for the Droid System.Windows project:

 Sn –e "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\System.Windows.dll" system_windows.snk  

-> Modify the Droid system.windows project to delay-sign using the extracted key. Put the following in a PropertyGroup in the csproj file:

<SignAssembly>true</SignAssembly>  <AssemblyOriginatorKeyFile>system_windows.snk</AssemblyOriginatorKeyFile>  <DelaySign>true</DelaySign>  

-> Change the assembly version of the Droid System.Windows project (in AssemblyInfo.cs) to:

2.0.5.0   

In my testing, I didn't seem to need to disable strong name verification. So I don't think it will present any extra barriers for newbies – once you have these changes made they'll just need to get your code and it will build correctly.

However, if you do run into problems, try running the following from an admin VS command prompt:

 sn -Vr *,7cec85d7bea7798e   

Let me know how this works!

I've tested it - it seems to work really, really well :) This solution is now pushed into vNext at https://github.com/slodge/MvvmCross/commit/f6a88048467838e5ac5ca687744dc0b2d1958aa8

It seems to solve:
- http://stackoverflow.com/questions/13028321/portable-class-library-strong-assembly-reference-problems-in-monotouch-monodroid
- http://stackoverflow.com/questions/13197546/mvvmcross-vnext-observablecolletion-is-defined-in-an-assembly-that-is-not-refer

2. The Xamarin team for solving all the issues caused by sln file changes in VS11/VS2012 - https://bugzilla.xamarin.com/show_bug.cgi?id=4919

These changes may sound trivial, but they've been making code sharing very hard since May this year - and it's great that I can now dropbox/skydrive share my projects and solutions again now between Mac and PC :)

3. Michael, Alan, Jeff (and others) within Xamarin for fixing the problems with building the new Profiles - including 104 - https://bugzilla.xamarin.com/show_bug.cgi?id=7173

I hope by naming a few people I haven't upset anyone else who's helped.

I really am grateful to everyone who's helping  :)

Now... I'm going back to write some more PCL code... :)

Tuesday, November 20, 2012

Merging vNextDialog back into vNext

Firstly.... apologies if these changes cause you any problems... but I've tidied up the source tree in vNextDialog and I think these changes will have positive benefits for all users. So I'm merging the changes back into vNext.

The key details of the changes are:
  • Dialogs
    • I've added a version of Android.Dialog/MonoDroid.Dialog to the source - this is in CrossUI.Droid
    • I've added a PCL library - CrossUI.Core - which contains the shared Dialog/Menu/List code
    • I've moved the MT.Dialog code out of MvvmCross Dialog and back into a CrossUI.Dialog class
  • AutoViews
    • I've added projects for AutoViews - these aren't finished yet... but are a very good step in the right direction!
    • I've added an AutoView sample - based on CustomerManagement. This isn't a 'best practice' sample - it's more a 'here's 3 ways of using autoviews' - so may not be easy to follow yet.
    • AutoViews currently only exist for MonoTouch and MonoDroid
  • Build Paths
    • I've changed the build paths so that all the DLLs build into /bin/debug and /bin/release 
    • Importantly this means it should be easier to do a binary release of MvvmCross again soon :)
    • One side effect of these changes is that you probably won't be able to build both of Droid/Touch at the same time - this is because they will fight over the System.Windows and System.Net Assembly names - but otherwise they should still build individually.
  • MonoTouch project configurations
    • The MonoTouch library projects are now switched to simpler Debug/Release only - I'll try to maintain this as we move forwards! 
If these changes break your code.... sorry

The main things that will need changing to get you back building are:
  • If you were using MonoTouch.Dialog, then you will need to add the CrossUI.Core and CrossUI.Dialog projects and you will need to change some Cirrious.MvvmCross.Dialog.Touch.Elements namespaces to CrossUI.Touch.Dialog.Elements
  • If you were relying on the iPhone/iPhoneSimulator project configurations, then you will need to use the Configuration Manager to adjust these back to simpler Debug/Release dependencies.
Sorry again for making these changes so suddenly... but I was informed today that a new user was having problems building the main tree... and I wanted to fix these problems.

This merge back seemed like the best way to fix them and to provide the best possible platform moving forwards.


Monday, November 19, 2012

Cross Platform .Net Podcast from Jesse Liberty, Jon Galloway and Miguel de Icaza

@JesseLiberty, @jongalloway and @migueldeicaza discuss open source and Mono things including a couple of discussions around MvvmCross and MonoCross :)

Worth a listen - there's lots of good technical info; interesting questions like 'what does Miguel do all day?'; some great phrases like 'the delight of using Native APIs'; an intriguing comment right at the end about a major product launch next year - "a universe of goodness"; plus some interesting background on the relationships between Mono, Ximian, Novell, Xamarin, MonkeySpace, Microsoft and ... of course ... Monkeys :)



For the audio: http://jesseliberty.com/wp-content/media/Show80.mp3

For a background post: http://jesseliberty.com/2012/11/08/yet-another-podcast-80miguel-de-icaza-mono/

Thanks for the mentions :) I really want to know what the product next year is now :)

Saturday, November 17, 2012

AlphaLabs Node Garden - adding speech

My first attempt at a play with the AlphaLabs Node Garden.

I thought using the screen was too much like manual labour - so I thought I'd try voice control.

The verdict - wow, is it simple to add voice control to your apps!






wp8: speech is off until your new language pack has been installed

If you see the error 'speech is off until your new language pack has been installed'

Then this might just be because you've switched your phone from one language to another.

To get over this problem...
  • go to Speech in Settings
  • tap on the language box
  • choose your language (even if it's your existing language)
  • you'll then be asked to download it.... (needs WiFi really)
  • after the download, the phone will need  a reboot...

The speech privacy policy was not accepted prior to attempting a speech recognition

If you are trying to use SpeechRecognition and you see this general Exception - "The speech privacy policy was not accepted prior to attempting a speech recognition" - or possibly you see the "The text associated with this error code could not be found."...

Then the answer is http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662934%28v=vs.105%29.aspx#BKMK_Handlingthespeechprivacypolicyerror

Basically - try pressing and holding the start key - then getting the user to accept the terms and conditions...

Also, in your own app... it seems like maybe you need to be sure you are requsting the speech recognition in an async call on the UI thread?

Some low light pictures taken with a Nokia 920

I took a Nokia 920 out for a run this morning.

It was a real Autumn day... rainy... overcast... gloomy...

Which made it perfect to test out the PureView floating lens in the 920 :)

These photos are just 'snaps' taken on the run... and the deer in Bushy Park weren't being at all friendly... but I'm definite that 'yes, the 920 has a quite nice camera!'













Friday, November 16, 2012

Aviva - Drive.... An MvvmCross Testimonial

Back at the end of the Summer I got this email through from a Solution Designer in Aviva - a very large UK Insurance company:

Thought you'd like to know that we are using MvvmCross in our RateMyDrive app that is currently being Beta tested: http://www.aviva.co.uk/ratemydrive/
There's been a fair amount of press about it, and it's even been on the telly:  http://www.bbc.co.uk/iplayer/episode/b01m9396/Click_18_08_2012/  (fast forward to 9:08)
So a big thank you for the major contribution your framework has made to this project. It has allowed us to share the complex algorithms for deriving the driver rating scores between Android, iOS and Console/Test apps. In fact 90% of the code is shared and easily testable.

This project is still ongoing - http://www.aviva.co.uk/drive - and I think the above quotation says everything you need to know about MvvmCross.... :)


If you've been using MvvmCross, and you have any feedback, then please do send it to me :)

Hackery and WitchCraft - First AutoViews running on MonoTouch too

Following on from the MonoDroid work, I've started pushing some MonoTouch changes now for AutoViews too...

And after only a few hours - mostly filled with Reflection swearing - I now have this list view:


and this Dialog view:


These screens generated from the exact same code and JSON as the Droid UIs in Another update on the Default UI work for MvvmCross....

There's still a lot of code to write... and lots of debugging to go...  especially when I move to release builds on real devices....

But so far so good :)

Thursday, November 15, 2012

Free icons for ASP.Net, WinRT and WP development...

These are some of the icon sets I've used in the past - generally Creative Commons - and always used with attribution.

For maps:
http://code.google.com/p/google-maps-icons/

For general use:
http://www.famfamfam.com/lab/icons/
http://code.google.com/p/fugue-icons-src/ - preview at: http://p.yusukekamiyamane.com/icons/preview/fugue.png

For WinRT/WP7
https://github.com/Templarian/WindowsIcons

- plus SyncFusion have a free set which is growing big now - http://www.syncfusion.com/downloads/metrostudio

- plus BootStrap from Twitter has some interesting icons built-in


Wednesday, November 14, 2012

Updated: Flurry Analytics in MonoDroid

This is a follow up to an earlier post on using Flurry Analytics in MonoTouch and MonoDroid: http://slodge.blogspot.co.uk/2012/04/using-flurry-analytics-from-monotouch.html

The community has spoken and one kind individual (I think it's this one) has contributed this gist back to the community with an extended Flurry API covered:



Excellent stuff - thanks "anonymous" :)

Lists in MvvmCross AutoView - first code :)

I've just completed the first stab at a List AutoView :)

This code still needs a little tinkering with - it will change as we go across to the other platforms, but a basic first pass is in this Gist:



Next up MonoTouch, and then WP and WinRT

Then back to Droid for Tab UIs too :)

Question: Should we try to shorten/simplify some of the MvvmCross class names?

I've done a few demos lately where I've had to write code live...

Doing this has made me pause and think when it comes to writing down names like: MvxBindableLinearLayout

These names seem overly verbose... e.g. wouldn't MvxLinearLayout do just as well?

Some of the names are unavoidable - e.g. MvxBindingTouchTableViewController inherits from MvxTouchTableViewController - but even these could be shortened to remove the Touch part of the name (the namespace already gives us that).

And then... of course... another question is whether Mvx should stay in place as a prefix? It is useful in places to know when you are using an MvvmCross class... but it's not very pretty and can make the code less readable.

There's nothing planned on this in the very short term, but what do people think?
  • Should we go on a big clean through the naming?
  • Should we try to shorten some names?
  • Should we try to remove the Mvx prefix?
  • Should we just focus on getting more code and better code (e.g. tests) in place?
Interested to hear any thoughts people have. Please feel free to leave comments here if you have any

Stuart

P.S. The main class name which made me pause and think on this topic was MvxActionBasedBindableTableViewSource - it's a good descriptive name, but something like MvxFuncTableViewSource might be easier on the eye ?

Sunday, November 11, 2012

More work on AutoViews for MvvmCross

I've been looking some more at the AutoView code.

In addition to hand-crafted Json, I'm looking at the idea of allowing users to provide a simple description within each ViewModel.

I initially started this by looking at using Attributes, but now I'm moving more towards getting the user to provide descriptive methods, like the one below. This code is now working on Droid - but some refactoring is still needed to properly integrate it and to make it really beautiful.

SSL problems with Microsoft Azure Mobile Services on Mono for Android (MonoDroid)

My main test Android device - a SIM-unlocked Galaxy Note upgraded to ICS - doesn't like any 'Microsoft Secure Server Authority' certificates. e.g. it doesn't like Hotmail.com or Live.com.

This is a problem if you try to use Azure Mobile Services - because https connections to a service like https://mydemoservice.azure-mobile.net will result in an AggregateException within which (several layers deep) will be a MobileServiceInvalidOperationException with a message saying just 'Send Failure' (derived from ServiceFilterResponseStatus SendFailure)

If anyone else encounters this issue... then below is some hacky code I transplanted from an old demo project. It seems to work.... but could probably be improved to work with just Microsoft Secure Server Authority messages.

This code hacks the ServicePointManager to allow it to accept all HTTPS/SSL addresses regardless of whether or not the certificate is trusted. Don't use this in your banking apps please :)

Saturday, November 10, 2012

Resources from Azure Mobile Services talk - MonoTouch and MonoDroid

I'm just pushing some resources for the Mvvm Azure Mobile Services sample shown at #SixStepsAzure yesterday to: https://github.com/slodge/azure-mobile-services

I'm afraid there's not too much info on this demo available yet and I've only included MonoTouch and MonoDroid code - there is a little in the readme.md... but generally I'll need to get together with @AzureCoder to sort out more - I don't know how he did the server side wizardry :)

Azure to Wp/MonoDroid/MonoTouch - Video of my MvvmCross Talk

Here's a talk I gave yesterday at #SixStepsAzure here in London:



Slidedeck is:



And this is what one of the audience said:




Love the honesty of that feedback :)

Friday, November 09, 2012

The request could not be completed (Send failure)

Update: see http://slodge.blogspot.co.uk/2012/11/ssl-problems-with-microsoft-azure.html


I've been playing with Azure Mobile Services on Mono for Android (and on MonoTouch too).

One thing that stumped me for a little while was a problem where I just couldn't talk to the server - all calls would fail with:

The request could not be completed (Send failure)

Eventually I worked out that:
  1. Make sure you've got INTERNET permissions in your app Manifest
  2. Make sure you are using http and not https for the service address

I'm not sure why https is not currently working - must be some SSL/certificate-level error?

Tuesday, November 06, 2012

Another update on the Default UI work for MvvmCross....

We've made more steady progress on the Default UI work.

We've now got the MvvmCross CustomerManagement demo (borrowed originally from MonoCross) completely rendering from JSON.


So, that's:
  • the front page screen (a List)
  • the details screen (a Dialog)
  • the edit and new screens (a Dialog)
  • a menu on each screen.

To do this, currently we're using JSON files loaded using convention rules from the Assets folder:



However, we want to move this to a set of conventions and/or attributes based on the ViewModels themselves. This is coming...

And then we'll look at porting this back to MonoTouch and MonoTouch.Dialog too...

And then also coming, is WP.Dialog - see @runegri's fork of MonoDroid Dialog at https://github.com/runegri/Android.Dialog

There's a lot of code to tidy up - but will post more details and some demo code soon!

How to make a PIG UDF (beginners guide for C# engineers)

I got asked to create a UDF in Java... this is what I did :)





Any questions? Try http://jabbr.net/#/rooms/HDInsight

For the Apache PIG UDF documents try Try http://pig.apache.org/docs/r0.8.1/udf.html

Monday, November 05, 2012

Thank you JetBrains for free Resharper open source licensing

Just a quick word of thanks.

JetBrains provide Reshaper for free for me to use on MvvmCross: http://www.jetbrains.com/resharper/

Thank you, JetBrains!

If you are a C# dev and you haven't tried a tool like Resharper then you are wasting your own time - simple as that. In addition to the free 7.0 license above, I've also paid my own money (wow) for a license - and it paid for itself within a day.

MvvmCross at BUILD 2012 - Create Cross Platform App using Portable Class Libraries

Daniel Plaisted's talk introduced and extended the MvvmCross Twitter sample at BUILD

For his full talk, see:




For more info, see http://channel9.msdn.com/Events/Build/2012/3-004

Daniel's blog is on: http://blogs.msdn.com/b/dsplaisted/

Sunday, November 04, 2012

Combining TinyMessenger with MvvmCross to provide "StartViewModelForResult" type behavior

See http://www.gregshackles.com/2012/11/returning-results-from-view-models-in-mvvmcross/

A sample from @gshackles

https://gist.github.com/f20d5f444234c78ca81a

Basically this pattern allows you to write a flow like:

- navigate from a parent viewModel to a child ViewModel
- the child viewModel collects some user input
- the user then presses OK
- a message is sent back from the child ViewModel  to the parent
- the child view then closes

We think there might be one very minor issues in this pattern - to do with some tombstoning edge cases - but for most apps this should work really well - and it has a nice test harness too!

Some Useful MvvmCross Links...

Key posts from http://slodge.blogspot.com and key http://stackoverflow.com/questions/tagged/mvvmcross questions and answers

Portable Class Libraries

Portable Class Library problems - "defined in an assembly that is not referenced" http://stackoverflow.com/questions/13197546/mvvmcross-vnext-observablecolletion-is-defined-in-an-assembly-that-is-not-refer
Working around the profile1-only problem in Mono builds - http://slodge.blogspot.co.uk/2012/10/mvvm-monotouch-back-up-and-running.html
More on PCL setup for MonoTouch/MonoDroid - http://slodge.blogspot.co.uk/2012/09/mvvmcross-vnext-portable-class.html
Xamarin reported bugs that @slodge is involved with - mostly PCL - https://bugzilla.xamarin.com/buglist.cgi?email2=me%40slodge.com&emailassigned_to2=1&emailcc2=1&emailreporter2=1&emailtype2=substring&list_id=33065&query_format=advanced&order=bug_id%20DESC&query_based_on=

General

Experiences and Limitations - http://stackoverflow.com/questions/10224376/mvvmcross-experiences-hindsight-limitations
Getting Help - http://slodge.blogspot.co.uk/2012/10/how-to-ask-questions-about-mvvmcross.html
Setting up a fork - basic GitHub steps - http://slodge.blogspot.co.uk/2012/09/heres-how-i-setup-fork.html

Navigation and Architecture

Passing in variables to ViewModels - http://stackoverflow.com/questions/10192505/passing-on-variables-from-viewmodel-to-another-view-mvvmcross
MethodAccessException - http://stackoverflow.com/questions/10227237/methodaccessexception-when-passing-variables-from-viewmodel-to-viewmodel-on-wp7
Providing different views for iPhone and iPad - http://stackoverflow.com/questions/10297260/mvvmcross-sharing-viewmodels-for-multiple-views
Replacing the default ViewModelLocator - http://stackoverflow.com/questions/10411735/how-to-replace-mvxdefaultviewmodellocator-in-mvvmcross-application
Passing in Services as constructor parameters - http://stackoverflow.com/questions/10511853/constructor-in-viewmodel
Problems in release mode only - http://stackoverflow.com/questions/11973993/mvxexception-in-release-mode-for-android
Hunting for memory leaks - http://stackoverflow.com/questions/12494804/helping-the-gc-in-mono-droid-using-mvvmcross
One pattern for error reporting - http://stackoverflow.com/questions/10411352/what-is-the-suggested-way-to-handle-exceptions-during-in-a-mvvmcross-application and also at http://stackoverflow.com/questions/11053535/alerts-or-popups-in-mvvmcross
Changes to IoC in vNext - http://slodge.blogspot.co.uk/2012/10/changes-to-ioc-in-vnext.html

Testing

Testing ViewModels - http://slodge.blogspot.co.uk/2012/10/testing-viewmodels-in-mvvmcross.html

Binding

JSON Binding introduction - http://stackoverflow.com/questions/10688603/how-do-i-bind-multiple-properties-in-an-android-layout-element
Custom Favorites Button Binding - http://stackoverflow.com/questions/10495137/mvvmcross-bindings-in-android Custom binding for text color - http://stackoverflow.com/questions/10700445/in-mvvmcross-how-do-i-do-custom-bind-properties
Binding MonoTouch UIViewController member variables - http://stackoverflow.com/questions/10929779/monotouch-mvvmcross-binding-to-instance-variables
Two way bindings for integers - http://stackoverflow.com/questions/11231624/mvvmcross-monotouch-c-sharp-binding-int-property-mode-twoway
Binding doesn't work on a real device - http://stackoverflow.com/questions/11349864/mvvmcross-monotouch-fail-to-bind-properties-on-a-real-ipad-but-it-works-on-th
Custom binding for a Touch event - http://stackoverflow.com/questions/11815893/mvvmcross-touch-command-binding-in-android
ListItem Property Binding - http://stackoverflow.com/questions/12825121/binding-a-property-to-a-mvxbindablelistview-in-android
Displaying images - http://stackoverflow.com/questions/12876406/how-to-bind-an-image-src-to-resource-drawable-image-with-mvvmcross and http://stackoverflow.com/questions/12925056/binding-to-path-imageview-in-mvvmcross-for-monodroid-android
What do I do without CommandParameters? http://stackoverflow.com/questions/12892672/mvvmcross-vnext-monodroid-commandparameter-similar-to-wp7
Why doesn't Touch work - http://stackoverflow.com/questions/12950879/mvvmcross-button-command-binding-not-firing
Working around ICommand CanExecute problems - http://stackoverflow.com/questions/12951733/how-to-use-canexecute-with-mvvmcross
Debugging binding problems - http://stackoverflow.com/questions/12973594/mvxbinderror-10-40-exception-thrown-during-the-view-binding

Droid

Using Tabs/TabActivity - http://stackoverflow.com/questions/10243672/how-to-use-a-monodroid-tabactivity-using-mvvmcross-framework
AutoComplete - http://stackoverflow.com/questions/10550829/autocomplete-mvvm-and-java-castings-without-using-java-lang-object-on-viewmodel
Removing the splash screen - http://stackoverflow.com/questions/10584385/how-do-i-initialize-the-mvvmcross-framework-without-a-splash-activity
Handling Back - http://stackoverflow.com/questions/10621593/monodroid-mvvmcross-handle-back-button-pressed-on-a-tabhost
I want a simple View without a ViewModel - http://stackoverflow.com/questions/10684174/navigate-to-a-view-without-viewmodel-in-mvvmcross
Fragment support - current not done - http://stackoverflow.com/questions/10698638/mvvmcross-viewtyperesolver-doesnt-resolve-tag-fragment-or-custom-type
Using custom Intents - http://stackoverflow.com/questions/12564272/making-mono-cross-platform-support-for-task-intent
Why won't my project include the MvxBindingAttributes.xml file - http://stackoverflow.com/questions/12596553/attributes-from-mvxbindingattributes-are-not-added-with-mvvmcross
Using ICommands within ListItems - http://stackoverflow.com/questions/12682082/mvvmcross-changing-viewmodel-within-a-mvxbindablelistview
Receiving broadcast actions - http://stackoverflow.com/questions/12687149/where-to-listen-for-broadcast-action-with-mvvmcross
Displaying Selection - http://stackoverflow.com/questions/12738516/does-mvvmcross-have-a-way-to-change-the-selector-when-clicking-imagebutton-on-li
Using custom controls in XML - http://stackoverflow.com/questions/12934654/how-to-create-views-actions-listener-for-mvxitemtemplate
Responding to checkbox changes - http://stackoverflow.com/questions/13120574/mvvmcross-vnext-checkbox-checkedchange-event-to-a-command-with-monodroid
Integrating a custom Activity - http://stackoverflow.com/questions/13201174/insert-a-monogame-view-inside-mvvmcross-monodroid-activity

Touch

Modal presentation (and custom presenters) - http://stackoverflow.com/questions/10512853/how-do-i-specify-a-view-to-be-pushed-as-modal-in-mvvmcross
Using Tabs/UITabBarController - http://stackoverflow.com/questions/10981985/mvvmcross-monotouch-uitabbarcontroller-cant-access-navigation-bar
Customising the Navigation Bar (UINavigationController) - http://stackoverflow.com/questions/11011218/mvvmcross-uinavigationcontroller-customise-navigationbar
Modal Views - with a UINavigationController - http://stackoverflow.com/questions/11037119/mvvmcross-using-a-modal-viewcontroller-from-a-tab
Displaying multiple modal views - http://stackoverflow.com/questions/11041605/why-does-mvxmodalsupporttouchviewpresenter-in-mvvmcross-only-support-one-modal-v
Using a DateTimeElement in MT.Dialog - http://stackoverflow.com/questions/11105125/mvvmcross-null-exception-when-using-datetimeelement-in-monotouch-dialog
How to do a "combobox"/Uipickerview in Touch http://stackoverflow.com/questions/12160239/mvvmcross-binding-lists-in-monotouch (also see https://github.com/slodge/MvvmCross/pull/25)
Problems with MT.D Element redrawing - http://stackoverflow.com/questions/12249758/mvvmcross-twoway-bindings-with-monotouch-dialog

WP7/WP8

Intercepting Back key presses - http://stackoverflow.com/questions/10515990/wp7-mvvmcross-detect-requestclose-or-backkeypressed-inside-viewmodels
Using live tiles - http://stackoverflow.com/questions/11566460/mvvmcross-and-wp7-secondary-tile

Services

Getting Location - http://stackoverflow.com/questions/10317025/monodroid-locationmanager-requestlocationupdates-gives-java-lang-illegalargument
Distance between 2 points - http://stackoverflow.com/questions/10331836/finding-the-distance-between-two-geo-locations-when-using-the-mvvmcross-framewor
Why no speed and bearing :( - http://stackoverflow.com/questions/11582345/why-is-mvvmcross-mvxgeolocationwatcher-not-returning-speed-or-bearing
Integrating VideoView from Xamarin.Mobile - http://stackoverflow.com/questions/13016103/mvvmcross-vnext-monodroid-use-a-videoview-inside-a-plugin

Plugins

How to write a Conventional plugin - http://stackoverflow.com/questions/12842727/mvvmcross-conventional-plugin-bypass
How to inject platform specific services - http://stackoverflow.com/questions/12564272/making-mono-cross-platform-support-for-task-intent
Another introduction to Conventional plugins - http://stackoverflow.com/questions/12931618/mvvmcross-vnext-merge-plugins-with-monodroid

"Simple Projects"

Multiple View/ViewModel sample - http://stackoverflow.com/questions/10430481/how-do-i-use-multiple-viewmodels-with-simple-binding

Wednesday, October 31, 2012

How to ask questions about MvvmCross?

If you've got questions... then that's good.

I love answering questions about Mvx and hearing about what users want.

Take a look at all the information that's already available - http://slodge.blogspot.co.uk/p/mvvmcross-quicklist.html

So please feel free to ask questions by:

1. You can post them on StackOverflow - http://stackoverflow.com/questions/tagged/mvvmcross - please think about your question and provide as much detail as you can - I generally spend about 10 minutes to write a good answer so please also spend 10 minutes writing a good question.

For all questions, please search first - if there are any similar problems/questions then consider referencing them in your question.

For complicated questions, please consider writing a separate small test app which focusses on the problem area, rather than posting all your code - no-one has time to read all your code :)

If you find you have followup questions... then please do not update your question... and please do not ask new questions in comments - open a new question instead :)

2. You can post them on http://forums.xamarin.com - but again the more relevant detail you can provide the better - consider adding a gist for code - http://gist.github.com/

3. If you think it is a bug or a new feature then you can open a new issue on https://github.com/slodge/MvvmCross/issues/new - ideally include some sample code that I can build and run - if you have a test application please put it in a repo somewhere. If I have to make a test app myself for each and every issue then I'll be slower to answer...

4. You can come along to http://jabbr.net/#/rooms/mvvmcross but please don't ask too many questions there - it's not a great place to ask questions to look at code or to share things really - and it's not very searchable so it's hard for answers to benefit others...

Looking forwards to hearing from you all :)

Stuart

Tuesday, October 30, 2012

Testing ViewModels in MvvmCross

One question I've been meaning to answer for a while is how I setup my unit tests so that I can test viewmodel behaviour.

This is actually very simple to do. There are just a couple of things to put in place to cope with the singleton nature of MvvmCross IoC

Also, please note that if you want to test on MonoTouch then because there are dynamic code restrictions, then you cannot use Dynamic Mocks (like Moq)

*1. First in the test setup, I clear the IoC system using code like:

    private IMvxServiceProviderRegistry _ioc;

    [SetUp]
    public void SetUp()
    {
        // fake set up of the IoC
        MvxOpenNetCfContainer.ClearAllSingletons();
        MvxOpenNetCfServiceProviderSetup.Initialize();
        _ioc = MvxServiceProvider.Instance;
        _ioc.RegisterServiceInstance(new MvxDebugTrace());
        MvxTrace.Initialize();
    }

*2. Then to test general navigation I use a couple of Mocks like:

public class MockMvxViewDispatcherProvider : IMvxViewDispatcherProvider
{
    #region IMvxViewDispatcherProvider implementation

    public IMvxViewDispatcher Dispatcher { get; set; }

    #endregion
}

public class MockMvxViewDispatcher : IMvxViewDispatcher
{
    public List CloseRequests = new List();
    public List NavigateRequests = new List();

    public MockMvxViewDispatcher()
    {
    }

    #region IMvxViewDispatcher implementation

    public bool RequestNavigate(MvxShowViewModelRequest request)
    {
        NavigateRequests.Add(request);
        return true;
    }

    public bool RequestClose(IMvxViewModel whichViewModel)
    {
        CloseRequests.Add(whichViewModel);
        return true;
    }

    public bool RequestRemoveBackStep()
    {
        throw new NotImplementedException();
    }

    #endregion

    #region IMvxMainThreadDispatcher implementation

    public bool RequestMainThreadAction(Action action)
    {
        action();
        return true;
    }

    #endregion
}

The main thing these Mocks appear to do is to catch and store the navigation requests.

IMPORTANT NOTE: however, please do note the IMvxMainThreadDispatcher code - this service is essential to much of the operation of MvvmCross - lots of things in MvvmCross rely on this service being available because they need to get their execution across to some "UI thread" - e.g. PropertyChanged will silently fail to fire if the service is missing!

*3. To then test navigation I use tests like:

    [Test]
    public void ExecutingTheLoginCommandNavigatesToTheLoginViewModel()
    {
        var mockNavigation = new MockMvxViewDispatcher();
        var mockNavigationProvider = new MockMvxViewDispatcherProvider();
        mockNavigationProvider.Dispatcher = mockNavigation;
        _ioc.RegisterServiceInstance(mockNavigationProvider);

        var homeViewModel = new HomeViewModel();
        homeViewModel.LoginCommand.Execute(null);

        Assert.That(mockNavigation.NavigateRequests.Count == 1);
        Assert.That(mockNavigation.NavigateRequests.First().ViewModelType == typeof(LoginViewModel));
    }

    [Test]
    public void ExecutingTheCloseCommandClosesTheViewModel()
    {
        var mockNavigation = new MockMvxViewDispatcher();
        var mockNavigationProvider = new MockMvxViewDispatcherProvider();
        mockNavigationProvider.Dispatcher = mockNavigation;
        _ioc.RegisterServiceInstance(mockNavigationProvider);

        var loginViewModel = new LoginViewModel();
        loginViewModel.CloseCommand.Execute(null);

        Assert.That(mockNavigation.CloseRequests.Count == 1);
        Assert.That(mockNavigation.CloseRequests.First() == viewModel);
    }

*4. And to test ViewModel property changes I just use simple code like:

    [Test]
    public void ExecutingTheAddCommandIncrementsTheCounter()
    {
        var mockNavigation = new MockMvxViewDispatcher();
        var mockNavigationProvider = new MockMvxViewDispatcherProvider();
        mockNavigationProvider.Dispatcher = mockNavigation;
        _ioc.RegisterServiceInstance(mockNavigationProvider);

        var tipViewModel = new TipViewModel();
        Assert.That(tipViewModel.Counter == 0);
        var notifications = new List();
        tipViewModel.PropertyChanged += (s, e) =>
            {
                notifications.Add(e.PropertyName);
            };

        tipViewModel.CloseCommand.Execute(null);

        Assert.That(mockNavigation.CloseRequests.Count == 0);
        Assert.That(mockNavigation.NavigateRequests.Count == 0);
        Assert.That(notifications.Count == 1);
        Assert.That(notifications[0] == "Counter");
        Assert.That(tipViewModel.Counter == 1);
    }

*5. And that's it... these tests work cross-platform - including in the lovely NUnit tool from Xamarin for MonoTouch

Possible solutions for WP8 SDK Emulator issues - WP8 Hyper-V emulator cannot see the wireless network adapter

Now the NDA is over...

I had a problem with windows phone 8 sdk accessing the wireless network on my host laptop.

Some solutions/questions I saw reported when trying to debug this were:

  • Plugin an Ethernet cable - that worked for me!
  • Problem solved! Hyper-V uses same MAC address for guest VMs (virtual machine) and Host. If the router configured to give the host always same ip address it will conflict with the emulator. Solution - on the router remove the host from known PCs and let it give you some new ip address (not fixed). After you start the emulator it will get the correct ip address from router. Router will show you two PCs (host and vm) with the same MAC, but different ip addresses.

  • I encountered a problem with installing Hyper-V on a german installation of Windows 8 but have found people having the same issue with other localized versions. After setting the checkbox to install Hyper-V and clicking ok it simply did not install. I had to change my regional settings to english, install it and switch them back to german for everything to work.

    Maybe the SDK simply triggered the installation correctly or the recent big Windows 8 patch resolved the problem. Although it might be that you had different problems with installing Hyper-V.

  • It is possible that the emulator's virtual machine is corrupted.

    1. Close Visual Studio. Launch Hyper-V Manager.

    2. In the Virtual Machines list, stop and then delete any virtual machines currently running

    3. Try your app again. A new emulator VM instance should start.

    If that doesn't fix it, click on the running VM instance in Hyper-V Manager. In the Actions column for your Emulator instance, click on Settings, and drill down into the Network adapter hardware. See if a Virtual Switch is selected for the network adapter etc.

  • Hi everyone, We have some steps to run the emulator:

You must have Windows 8 Pro (Ultimate or Enterprise).
Enable Hyper-V on Control panel.
Restart your computer.
Install Windows Phone 8 SDK.
Restart your computer, again.
Run the Emulator! Takes very very long time if you don't do the step 5.
Happy coding!

Origo Foci-Eb 2012 - an example mvvmcross app from earlier this year

This App launched in Hungary this year ahead of the European Football Championships.

It was built on MonoDroid, MonoTouch, WP7 and MvvmCross

It shows really nicely how to show the same ViewModel data in a nice Native UI style.

I couldn't find the iOS screenshots, but some Droid and WP7 goodness is below:

Android  - https://play.google.com/store/apps/details?id=OrigoEB.Main



WindowsPhone http://www.windowsphoneapplist.com/en/Origo_FociEb_2012-a116571.html



The developer was - I believe he or one of his team may also have something to do with the excellent sample at https://github.com/Zoldeper/Blooor

MonoTouch, MonoDroid and MvvmCross at Build Windows 2012 in Seattle #BldWin

From http://channel9.msdn.com/Events/Build/2012/3-004:

Learn how to create an app with versions for the Windows Store, Windows Phone, and other platforms, using the new Portable Class Libraries support in Visual Studio 2012 to share code between the different versions of the app. We will see how the Model-View-ViewModel pattern (MVVM) is ideally suited to sharing code between platforms since it encourages a clean separation between the app logic, which can be shared, and the UI, which is platform-specific. We'll see how to access non-portable functionality from portable code by creating a portable abstraction with platform-specific implementations. We will see several real-world demo apps, and touch on more advanced concepts such as navigation, inversion of control, and synchronizing data across multiple clients with Windows Azure Service Bus. To maximize your benefit from this session, having some prior experience with XAML-based apps and the MVVM pattern is recommended.

I don't know what the content will be...

But if it's anything like this blog post - http://blogs.msdn.com/b/dsplaisted/archive/2012/08/27/how-to-make-portable-class-libraries-work-for-you.aspx - then it should be very useful :)

Sunday, October 28, 2012

A temporary solution for the Profile1 only bug in MonoDevelop MonoTouch PCL support

Update: install the patch - http://slodge.blogspot.co.uk/2013/02/a-patched-monodevelop-for-pcls.html

Thanks especially to "Jonathan Peppers"...

There is a solution to the problem that MonoDevelop can only build Profile1 for MonoTouch PCL libraries.

The solution is to use Conditional MSBuild attributes.

So... replace:

    <TargetFrameworkProfile>Profile104</TargetFrameworkProfile>
with:
    <TargetFrameworkProfile Condition="'$(OS)' != 'Windows_NT'">Profile1</TargetFrameworkProfile>      <TargetFrameworkProfile Condition="'$(OS)' == 'Windows_NT'">Profile104</TargetFrameworkProfile>
This can be done using Replace In Files :)

Afterwards it seems to work perfectly in both Visual Studio and in MonoDevelop :)

Stuart

Saturday, October 27, 2012

Mvvm MonoTouch back up and running :)

I've got a new Mac Air

Bought it through the refurb store - feels like new :)

The good news is that with just a few additions/changes I can build and run the Mvvm Monotouch solution in vNext in https://github.com/slodge/mvvmcross

The small hacks are:

Edit the file /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild/Microsoft/Portable/v4.0/Microsoft.Portable.CSharp.targets, finding the PropertyGroup that sets

  <TargetFrameworkIdentifier>MonoTouch</TargetFrameworkIdentifier>  

And to it, adding the lines:

  <CscToolExe>smcs</CscToolExe>  <CscToolPath>/Developer/MonoTouch/usr/bin</CscToolPath>

Note that doing this needs R+W permission on that file.

----

Then after that, you need to convert all the portable CSProj files so that they use Profile1, not Profile104 (but back on the PC you will need Profile104 again)

To do this - replace in files, choose *.csproj, and choose to replace ">Profile104<" with ">Profile1<"

----

So now back to work... :)

Friday, October 26, 2012

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information

To fix this error.... first find the Assembly which is causing the problem!

Useful code from http://stackoverflow.com/questions/1091853/unable-to-load-one-or-more-of-the-requested-types-retrieve-the-loaderexceptions
  
using System.IO;
using System.Reflection;

try
{
    //The code that causes the error goes here.
}
catch (ReflectionTypeLoadException ex)
{
    StringBuilder sb = new StringBuilder();
    foreach (Exception exSub in ex.LoaderExceptions)
    {
        sb.AppendLine(exSub.Message);
        if (exSub is FileNotFoundException)
        {
            FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
            if(!string.IsNullOrEmpty(exFileNotFound.FusionLog))
            {
                sb.AppendLine("Fusion Log:");
                sb.AppendLine(exFileNotFound.FusionLog);
            }
        }
        sb.AppendLine();
    }
    string errorMessage = sb.ToString();
    //Display or log the error based on your application.
}

MvvmCross - experiences, hindsight, limitations?

I get asked a lot about the benefits and problems of mvvmcross... sometimes it's phrased just like 'mvvmcross - wtf?'

The answer is always to point them at this question on StackOverflow -

MvvmCross experiences, hindsight, limitations?

Wednesday, October 24, 2012

Going outside of mvvm sometimes - live video preview in mvvmcross/monodroid

An interesting topic came up yesterday on StackOverflow.

The question was about video views and how to get native objects working inside portable code.

The answe I gave was a bit cowardly... It was to do most of the code natively (using xamarin mobile helpers) and to then bind to the view model at quite a simple level.

The poster took my advice and has now posted their code.... https://gist.github.com/3945799

There are definitely still places where more could be abstracted... And I'm still thinking about whether my original advice was correct...

Still thinking...

Tuesday, October 23, 2012

More progress on the Portable UI prototype

I now have a working sample on Droid with JSON loaded for both Menus and for Dialogs.

These files are automatically picked up using Conventions - no configuration required.

Next steps...
  • tidy it up a bit (thank you Resharper!)
  • add a list/listitem format,
  • try it out on Touch, WP and WinRT

Sunday, October 21, 2012

About me and my company - Stuart Lodge, Cirrious Ltd

Just a quick overview of some of the lovely things I work on:



https://speakerdeck.com/u/cirrious/p/cirrious-ltd