Skip to content

Instantly share code, notes, and snippets.

@slodge
Created May 22, 2013 08:17
open System
open System.Drawing
open MonoTouch.UIKit
open MonoTouch.Foundation
open ReachingNirvana.Core
open Cirrious.MvvmCross.Binding
open Cirrious.MvvmCross.Binding.BindingContext
open Cirrious.MvvmCross.Touch.Views
[<Register ("FirstView")>]
type FirstView () =
inherit MvxViewController ()
let label = new UILabel()
let textBox = new UITextField()
override this.ViewDidLoad () =
base.ViewDidLoad ()
label.Frame <- new RectangleF((float32)0,(float32)0,(float32)320,(float32)50)
this.Add(label)
textBox.Frame <- new RectangleF((float32)0,(float32)70,(float32)320,(float32)50)
this.Add(textBox)
let set = MvxBindingContextOwnerExtensions.CreateBindingSet<FirstView,FirstViewModel>(this)
set.Bind(label).To("Hello") |> ignore
set.Bind(textBox).To("Hello") |> ignore
set.Apply()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment