Xamarin.Forms 101: Data Binding

Sign in to queue

The Discussion

  • User profile image
    Flem100

    Thank you James. I really like this super simple introduction to MVVM, I needed that. Well done. 

  • User profile image
    CSMR2

    Actually traditional MVVM bindings are a really clunky approach.

    Doing this from code using a reactive library (e.g. Gjallarhorn) you can have
    in the ViewModel

    changingText:ISignal<string>

    and then in the view code

    changingText |> bind (fun t -> label.Text <- t)

    To go in the other direction, you have in the ViewModel

    changingText:IMutatable<string>

    and then in the view code
    entry.TextChanged.Subscribe(fun _ -> changingText.Value <- entry.Text)

    This 1. avoids INotifyPropertyChanged scaffolding, 2. makes the logic explicit, 3. doesn't require reflection and magic strings, 4. is nicely type-checked, 5. avoids Value Converter yuckiness.

  • User profile image
    javakian1

    Nice and simple

  • User profile image
    HjorturPalmi

    Great video! Thanks!

  • User profile image
    shrikant0712
    Nice and very crisp....

Add Your 2 Cents