Monday, July 01, 2013

Nuget beta version available...

There's a new nuget beta version I've just uploaded.

It's available as 3.0.9-beta - so will only be shown if you have the prerelease flag set.

It's a bit hard to explain what's in this beta version right now - I'm away from the home office again this week...

The big new things are that there are a couple of new packages which enable binding to methods and to fields... so right now I'm looking at a ViewModel which looks like:


public class Person
{
public INC<string> FirstName = new NC<string>("Fred");
public INC<string> LastName= new NC<string>("Flintstone");
}
public class FirstViewModel
: MvxViewModel
{
public INC<string> Updating = new NC<string>("Laugh");
public INC<Person> Child = new NC<Person>(new Person());
public void Go()
{
Updating.Value = "Whippy";
var person = new Person();
person.FirstName.Value = "James";
person.LastName.Value = "Bob";
Child.Value = person;
}
}
view raw inline.cs hosted with ❤ by GitHub

Within a Droid  UI this can be bound to as:


<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
local:MvxBind="Text Updating"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
local:MvxBind="Text Updating"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
local:MvxBind="Text Child.FirstName"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
local:MvxBind="Text Child.FirstName"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
local:MvxBind="Text Child.LastName"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
local:MvxBind="Text Child.LastName"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Go"
local:MvxBind="Click Go"
/>
</LinearLayout>
</ScrollView>
view raw droid.xml hosted with ❤ by GitHub


I will be back with more info 'soon'... just working too hard!

Have fun out there :)

3 comments:

  1. Great, Slodge! Arming with new toys ;)
    I still need to check work command with CommandParameter in new release.

    Thanks!

    ReplyDelete
  2. Very interesting, I'm speculating but presumably NC is Notify Change and you've found a way of hiding the RaisePropertyChanged ceremony?

    ReplyDelete