Tuesday, March 12, 2013

Hot Tuna Fragments

v3 of MvvmCross finally brings some Android Fragment action to MvvmCross

The integration is still a work in progress, but you can see some Fragment binding in https://github.com/slodge/FragmentSample/

This sample shows some basic principles:

- A fragment declared in AXML and it's DataContext (ViewModel) set in Code Behind

- Fragment switched in/out of a ViewGroup container programmatically using Code Behind

- Fragments loaded into Tabs

- Fragments used in Dialogs


There's still plenty more to learn and explore in these Fragments - the lifecycle of fragments really is a bit odd... so this code isn't really fully production ready yet...

There's also quite a few other things to try - like maps, view pagers and bound fragment collections...

But at least fragments can now be used and can be easily data-bound :)

No comments:

Post a Comment