Wednesday, June 12, 2013

Intercepting RaisePropertyChanged

We've recently pushed an update which allows developers to intercept all MvxNotifyPropertyChanged notifications if you want to.

The aim of this is to allow you to provide custom RaisePropertyChanged functionality.

At this first release, the framework doesn't provide any standard Interceptors - but we might write an initial one at some point soon.


An example Interception

The core of interception is the IMvxInpcInterceptor interface.


    public interface IMvxInpcInterceptor
    {
        MvxInpcInterceptionResult Intercept(IMvxNotifyPropertyChanged sender, PropertyChangedEventArgs args);
    }


You might use this, for example, to provide things like automated additional notifications for certain types - e.g. you might use it to send dependent change notifications.

For example, suppose you have a Person ViewModel with properties:
  • FirstName
  • LastName
  • FullName

This new functionality would allow you to provide an interceptor which would automatically send a FullName change notification whenever FirstName or LastName change - ie.e you could implement this interceptor as:

    public class MyInterceptor : IMvxInpcInterceptor
    {
        public MvxInpcInterceptionResult Intercept(
                        IMvxNotifyPropertyChanged sender,
                        PropertyChangedEventArgs args)
        {
            if (sender.GetType () == typeof(Person)) 
            {
                if (args.PropertyName == "FirstName" ||
                    args.PropertyName == "LastName") 
                {
                    sender.RaisePropertyChanged ("FullName");
                }
            }

            return MvxInpcInterceptionResult.RaisePropertyChanged;
        }
    }



With this done you could then register your implementation with IoC during Setup.InitializeInpcInterception - e.g.

        protected override void InitializeInpcInterception()
        {
            Mvx.RegisterSingleton((
IMvxInpcInterceptor)new MyInterceptor());
        }


For release software, I wouldn't normally expect you to use this particular interceptor implementation, but I hope this illustrates how you might be able to use this mechanism.



For inspiration!


For some inspiration about the sort of thing that some people are doing in a similar area, take a look at the excellent: https://github.com/zleao/MvvmCross-PropertyChangedEventPropagation

CommandParameter binding


We recently added a special CommandParameter parse step to allow the binding to specify fixed values (strings, ints, bools) to ICommand bindings.

This can be used as:

        local:MvxBind="Click MyCommand,CommandParameter=Thursday"

which uses a ValueConverter to turn a Click into a call on:

       MyCommand.Execute("Thursday")

So can be received in

       new MvxCommand(day => DoAction(day));
      
This helps where you want to reuse a command across multiple buttons

However, please note that this cannot be used currently with valueconverters - as it itself uses a valueconverter to achieve the effect.

Hope that helps :)

Tuesday, June 11, 2013

My standard reply to MvvmCross support emails

This is the type of message I generally send to everyone when they send me an email about MvvmCross. I'm afraid I currently get perhaps 5 emails every day and answering them is simply not efficient or practical
 
Thanks for understanding

Stuart






Hi (friend)

Thanks for the email

I provide lots of support to the community and I do this in public. I find talking in public is better:
  • it helps as many people as possible and 
  • it allows others to also help out with answers - most of the best ideas come from other people.

Questions

If you need help or have questions, please try asking on StackOverflow or on the Xamarin forums - I and others can help there. Please provide a good level of detail in your question - e.g.:
  • if you have a question about an exception, then please include some code near where the error occurred and the exception message and stack trace.
  • if you have a question about an idea or concept, then maybe try adding a diagram that will help others understand the concept - and tell everyone what you've already tried

If you ask a good question, then I and others will often spend hours answering it. If you ask a vague one sentence question that lacks detail, then no-one will be able help you. The better your question - the better the answers.

There are some great tips on asking questions in http://stackoverflow.com/help/on-topic


Bugs and Features

If you believe you have found a bug or if you have a new Feature Request, then please try raising an issue on github - https://github.com/slodge/MvvmCross/issues/new - but please again include a good level of information if you can. It really helps if you can provide a complete github repo which demonstrates the problem - this makes it easier and quicker for people to find, fix and test the problem - so quicker for you to get a solution.

MvvmCross also accepts pull requests from other github repos. Please only send a pull request if you agree to have your code shared under the MvvmCross license. Pull requests including Unit Tests are encouraged - I am trying to improve the test coverage inside MvvmCross. Also please understand that currently I do personally maintain and support MvvmCross - so please do understand that sometimes I may decide not to merge your request. My aim is to try to keep MvvmCross extensible - so even if a Pull Request is not accepted, then you will still hopefully be able to work on a fork or in an extension in order to use that functionality yourself.


Privacy

If after reading this, you decide you still really need 1-to-1 support because of business reasons, then I understand and can provide this, but only as a paid business option. You are welcome to email me about that if you need it.


Thanks for understanding

Best wishes

Stuart

Monday, June 10, 2013

N=26 - Down at Android Fragments Rock (N+1 Days of MvvmCross)

Today N+1 is back!


Sorry about the short break... and sorry about before another short break that's coming up - I'm going to NDC Oslo in Norway this week :)



Today, we're talking about Fragments!







Fragments are an Android-only thing. They're a type of User Control and they were invented by Jim Henson*


In this N+1 we talk through:

  • how to data-bind static fragments
  • how to data-bind dynamic fragments
  • briefly how to data-bind fragments in:
  • tabs
  • dialogs
  • the little-known MvxFrameControl


For more on fragments:





The video is:














Today's source code is available on: https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-26-Fraggle



A full and wonderful index for N+1 is available on





---

* ok, not really :) For more on Fraggle Rock... http://muppet.wikia.com/wiki/Fraggle_Rock - which is where the images above come from (under CC). Also for the full Fraggle Rock theme song, try http://www.youtube.com/watch?v=l_zsz_MlVvI

Sunday, June 09, 2013

Presenter roundup

There have been quite a few awesome* custom presenters around recently. Among the highlights have been:


Better Tabbing


A custom tab presenter that combines UINavigationController and UITabBarController more neatly: http://deapsquatter.blogspot.co.uk/2013/06/custom-presenter-for-uitabbarcontroller.html



Navigation by Fragments


An excellent tutorial on how to navigate using fragments in Android - http://enginecore.blogspot.ro/2013/06/more-dynamic-android-fragments-with.html



Stack Clearing


A custom presenter that allows you to request the iOS back stack to be cleared

https://gist.github.com/gshackles/5735595


A Presenter combined with a sliding 'hamburger' menu


A full sample using a sliding hamburger menu - https://github.com/fcaico/MvxSlidingPanels.Touch/blob/master/MvxSlidingPanelsSample.Touch/MvxSlidingPanelsTouchViewPresenter.cs


N+1

There have been a couple of videos recently:



And finally.... A presenter presentation...





* judging for badges of awesomeness still pending!

Friday, June 07, 2013

IoC and ServiceLocation in v3 - a brain dump....

Two key ideas that are use in MvvmCross are:
  • the Service Locator pattern
  • Inversion of Control

There are lots of articles and introductions available on this - some good starting places are Martin Fowler's introduction and Joel Abrahamsson's IoC introduction. I've also made some animated slides as a simple demonstration.



Specifically within MvvmCross, we provide a single static class Mvx which acts as a single place for both registering and resolving interfaces and their implementations.

 

Service Location - Registration and Resolution


The core idea of MvvmCross Service Location is that you can write classes and interfaces like:
    public interface IFoo
    {
         string Request();
    }

    public class Foo : IFoo
    {
        public string Request()
        {
            return "Hello World";
        }
    }

 

Singleton Registration


With this pair written you could then register a Foo instance as a singleton which implements IFoo using:
    // every time someone needs an IFoo they will get the same one
    Mvx.RegisterSingleton<IFoo>(new Foo());
If you did this, then any code can call:
    var foo = Mvx.Resolve<IFoo>();
and every single call would return the same instance of Foo

 

Lazy Singleton Registration


As a variation on this, you could register a lazy singleton. This is written
    // every time someone needs an IFoo they will get the same one
    // but we don't create it until someone asks for it
    Mvx.RegisterSingleton<IFoo>(() => new Foo());
In this case:
  • no Foo is created initially
  • the first time any code calls Mvx.Resolve<IFoo>() then a new Foo will be created and returned
  • all subsequent calls will get the same instance that was created the first time

 

'Dynamic' Registration


One final option, is that you can register the IFoo and Foo pair as:
    // every time someone needs an IFoo they will get a new one
    Mvx.RegisterType<IFoo, Foo>();
In this case, every call to Mvx.Resolve<IFoo>() will create a new Foo - every call will return a different Foo.

Last-registered wins


If you create several implementations of an interface and register them all:
    Mvx.RegisterType<IFoo, Foo1>();
    Mvx.RegisterSingleton<IFoo>(new Foo2());
    Mvx.RegisterType<IFoo, Foo3>();
Then each call replaces the previous registration - so when a client calls Mvx.Resolve<IFoo>() then the most recent registration will be returned.

This can be useful for:
  • overwriting default implementations
  • replacing implementations depending on application state - e.g. after a user has been authenticated then you could replace an empty IUserInfo implementation with a real one.

 

Bulk Registration by Convention


The default NuGet templates for MvvmCross contain a block of code in the core App.cs like:
        CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();
This code uses Reflection to:
  • find all classes in the Core assembly
    • which are creatable - i.e.:
      • have a public constructor
      • are not abstract
    • with names ending in Service
  • find their interfaces
  • register them as lazy singletons according to the interfaces they support

Technical Note> the lazy singleton implementation here is quite technical - it ensures that if a class implements IOne and ITwo then the same instance will be returned when resolving both IOne and ITwo.

The choice of name ending here - Service - and the choice to use Lazy singletons are only personal conventions. If you prefer to use other names or other lifetimes for your objects you can replace this code with a different call or with multiple calls like:
        CreatableTypes()
            .EndingWith("SingleFeed")
            .AsInterfaces()
            .RegisterAsLazySingleton();
        CreatableTypes()
            .EndingWith("Generator")
            .AsInterfaces()
            .RegisterAsDynamic();
        CreatableTypes()
            .EndingWith("QuickSand")
            .AsInterfaces()
            .RegisterAsSingleton();
There you can also use additional Linq helper methods to help further define your registrations if you want to - e.g. Inherits, Except. WithAttribute, Containing, InNamespace ... e.g.
        CreatableTypes()
            .StartingWith("JDI")
            .InNamespace("MyApp.Core.HyperSpace")
            .WithAttribute(typeof(MySpecialAttribute))
            .AsInterfaces()
            .RegisterAsSingleton();
And you can also, of course, use the same type of registration logic on assemblies other than Core - e.g.:
        typeof(Reusable.Helpers.MyHelper).Assembly.CreatableTypes()
            .EndingWith("Helper")
            .AsInterfaces()
            .RegisterAsDynamic();
Alternatively, if you prefer not to use this Reflection based registration, then you can instead just manually register your implementations:
        Mvx.RegisterSingleton(new MyMixer());
        Mvx.RegisterSingleton(new MyCheese());
        Mvx.RegisterType();
        Mvx.RegisterType();
The choice is your's

Constructor Injection


As well as Mvx.Resolve, the Mvx static class provides a reflection based mechanism to automatically resolve parameters during object construction.

For example, if we add a class like:
    public class Bar
    {
        public Bar(IFoo foo)
        {
            // do stuff
        }
    }
Then you can create this object using:
    Mvx.IocConstruct();
What happens during this call is:
  • MvvmCross:
    • uses Reflection to find the constructor of Bar
    • looks at the parameters for that constructor and sees it needs an IFoo
    • uses Mvx.Resolve() to get hold of the registered implementation for IFoo
    • uses Reflection to call the constructor with the IFoo parameter

 

Constructor Injection and ViewModels


This "Constructor Injection" mechanism is used internally within MvvmCross when creating ViewModels.

If you declare a ViewModel like:
     public class MyViewModel : MvxViewModel
     {
         public MyViewModel(IMvxJsonConverter jsonConverter, IMvxGeoLocationWatcher locationWatcher)
         {
            // ....
         }
     }

then MvvmCross will use the Mvx static class to resolve objects for jsonConverter and locationWatcher when a MyViewModel is created.


This is important because:
  1. It allows you to easily provide different locationWatcher classes on different platforms (on iPhone you can use a watcher that talk to CoreLocation, on WindowsPhone you can use a watcher that talks to System.Device.Location
  2. It allows you to easily provide mock implementations in your unit tests
  3. It allows you to override default implementations - if you don't like the Json.Net implementation for Json, you can use a ServiceStack.Text implementation instead.

 

Constructor Injection and Chaining


Internally, the Mvx.Resolve mechanism uses constructor injection when new objects are needed.

This enables you to register implementations which depend on other interfaces like:
     public interface ITaxCalculator
     {
         double TaxDueFor(int customerId)
     }

     public class TaxCalculator
     {
         public TaxCalculator(ICustomerRepository customerRepository, IForeignExchange foreignExchange, ITaxRuleList taxRuleList)
         {
             // code...
         }

         // code...
     }
If you then register this calculator as:
     Mvx.RegisterType<ITaxCalculator, TaxCalculator>();
Then when a client calls Mvx.Resolve<ITaxCalculator>() then what will happen is that MvvmCross will create a new TaxCalculator instance, resolving all of ICustomerRepository IForeignExchange and ITaxRuleList during the operation.

Further, this process is recursive - so if any of these returned objects requires another object - e.g. if your IForeignExchange implementation requires a IChargeCommission object - then MvvmCross will provide Resolve for you as well.

 

How do I use IoC when I need different implementations on different platforms?


Sometimes you need to use some platform specific functionality in your ViewModels. e.g. for example, you might want to get the current screen dimensions in your ViewModel - but there's no existing portable .Net call to do this.

When you want to include functionality like this, then there are two main choices:
  1. Declare an interface in your core library, but then provide and register an implementation in each of your UI projects.
  2. Use or create a plugin

 

1. PCL-Interface with Platform-Specific Implementation


In your core project, you can declare an interface and you can use that interface in your classes there - e.g.:
    public interface IScreenSize
    {
        double Height { get; }
        double Width { get; }
    }

    public class MyViewModel : MvxViewModel
    {
        private readonly IScreenSize _screenSize;

        public MyViewModel(IScreenSize screenSize)
        {
             _screenSize = screenSize;
        }

        public double Ratio
        {
            get { return (_screenSize.Width / _screenSize.Height); }
        }
    }
In each UI project, you can then declare the platform-specific implementation for IScreenSize - e.g. a trivial example is:
    public class WindowsPhoneScreenSize : IScreenSize
    {
        public double Height { get { return 800.0; } }
        public double Width { get { return 480.0; } }
    }
You can then register these implementations in each of the platform-specific Setup files - e.g. you could override MvxSetup.InitializeFirstChance with
    protected override void InitializeFirstChance()
    {
        Mvx.RegisterSingleton<IScreenSize>(new WindowsPhoneScreenSize());
        base.InitializeFirstChance();
    }
With this done, then MyViewModel will get provided with the correct platform specific implementation of IScreenSize on each platform.

 

2. Use or create a plugin


A Plugin is an MvvmCross pattern for combining a PCL assembly, plus optionally some platform specific assemblies in order to package up some functionality.

This plugin layer is simply a pattern - some simple conventions - for naming related Assemblies, for including small PluginLoader and Plugin helper classes, and for using IoC. Through this pattern it allows functionality to be easily included, reused and tested across platforms and across applications.

For example, existing plugins include:
  • a File plugin which provides access to System.IO type methods for manipulating files
  • a Location plugin which provides access to GeoLocation information
  • a Messenger plugin which provides access to a Messenger/Event Aggregator
  • a PictureChooser plugin which provides access to the camera and to the media library
  • a ResourceLoader plugin which provides a way to access resource files packaged within the .apk, .app or .ipa for the application
  • a SQLite plugin which provides access to SQLite-net on all platforms.

Plugin Use 

 If you want to see how these plugins can be used in your applications, then:

Plugin Authoring 

 Writing plugins is easy to do, but can feel a bit daunting at first.

The key steps are:
  1. Create the main PCL Assembly for the plugin - this should include:
    • the interfaces your plugin will register
    • any shared portable code (which may include implementations of one or more of the interfaces)
    • a special PluginLoader class which MvvmCross will use to start the plugin
  2. Optionally create platform specific assemblies which:
    • is named the same as the main assembly but with a platform specific extension (.Droid, .WindowsPhone, etc(
    • contains
      • any platform specific interface implementations
      • a special Plugin class which MvvmCross will use to start this platform-specific extension
  3. Optionally provide extras like documentation and nuget packaging which will make the plugin easier to reuse.

I'm not going to go into any more detail on writing plugins here.

If you'd like to see more about writing your own plugin, then:

 

What if...

 

What if... I don't want to use Service Location or IoC


If you don't want to use this in your code, then don't.

Simply remove the CreatableTypes()... code from App.cs and then use 'normal code' in your ViewModels - e.g.:
     public class MyViewModel : MvxViewModel
     {
         private readonly ITaxService _taxService;

         public MyViewModel()
         {
             _taxService = new TaxService();
         }
     }

 

What if... I want to use a different Service Location or IoC mechanism


There are lots of excellent libraries out there including AutoFac, Funq, MEF, OpenNetCF, TinyIoC and many, many more!

If you want to replace the MvvmCross implementation, then you'll need to:
  • write some kind of Adapter layer to provide their service location code as an IMvxIoCProvider
  • override CreateIocProvider in your Setup class to provide this alternative IMvxIoCProvider implementation.
Alternatively, you may be able to organise a hybrid situation - where two IoC/ServiceLocation systems exist side-by-side.

 

What if... I want to use Property Injection as an IoC mechanism


There is an example Property Injection implementation for IoC provided.

This can be initialised using a Setup override of:
  protected override IMvxIoCProvider CreateIocProvider()
  {
      return MvxPropertyInjectingIoCContainer.Initialise();
  }

 

What if... I want advanced IoC features like child containers


The IoC container in MvvmCross is designed to be quite lightweight and is targeted at a level of functionality required in the mobile applications I have built.

If you need more advanced/complex functionality, then you may need to use a different provider or a different approach - some suggestions for this are discussed in: Child containers in MvvmCross IoC

 


Note: this article is part of the v3 attempt to get MvvmCross documentation produced. If you'd like to help with this work, please say hello on https://github.com/slodge/MvvmCross/issues/252 - we need you!

Thursday, June 06, 2013

Wednesday, June 05, 2013

Some code for finding LoaderExceptions

Just for my own future reference really....


An MvvmCross v1 Xamarin.Android app for crime witnesses

Just heard that Self Evident has been published on the Google Play store: https://play.google.com/store/apps/details?id=org.witnessconfident.app



Self Evident is a free app that records, validates and secures evidence. While the android version has been designed primarily as a crime reporting app, it also lets you file a report for work, notify an adviser or business of a claim, send the media a news story or just secure the evidence in your private account. 

It's built using the original v1 of MvvmCross with input from a few UK developers including Matthew at Sky Fish Technologies and Gavin at GB Software Solutions.

Tuesday, June 04, 2013

Small Breaking Change for Dialog code

I've just committed some MvvmCross Touch and Android dialog code which will cause a small breaking change for existing implementations.


The main breaking change is that the `Bind` extension methods have moved from the individual Dialog projects to a shared location:

Cirrious.MvvmCross.Binding.BindingContext


If you use Dialog, then you will soon need to change your code to include a using for this namespace.


Beyond that, I've also included some excellent AutoView updates from @csteeg and I've committed some additional changes which:
  • unify the DateTime Element behaviour across both platforms
  • includes a default binding target name of Value for all ValueElements
  • includes Expression based binding for all Elements.

You can see this new Expression based binding in:





To compare this to the previous code, see the diff in the revision history: https://gist.github.com/slodge/5706116/revisions - the old code will still work, but the new Expression based code may be easier to use because of its intellisense and refactoring support.

Monday, June 03, 2013

N=25 - Tabs - N+1 Days of MvvmCross

Following on from splitview presenters, this talk gives an introduction into using tabs on Xamarin.Android, Xamarin.iOS and WindowsPhone.


For WindowsPhone, we use a Panorama as the local equivalent of Tabs - and we also mention Pivots.


For iOS, we show how to use a custom presenter to perform navigation within a tab child.


For Android, we hint at a future discussion of Fragments, but for now we discuss only Activities.


The video is:






The code is at https://github.com/slodge/NPlus1DaysOfMvvmCross/tree/master/N-25-Tabbed


For more on the N+1 series, check out this excellent index - http://mvvmcross.wordpress.com/ - thanks Aboo!

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 blasé 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: