Configuring two-way data binding

Binding data to a view via code or XAML is easy; nothing special is needed to present data from an object to the view. Binding a POCO class will only give you that though. Updating the source object and expecting to reflect the change to the target view or trying to push the values changed by the user from the target to the source will not work out of the box.

How to do it…

  1. Start by creating a Visual Studio Blank App (Xamarin.Forms Portable) solution. In the top menu, click File | New | Project… and give it the name XamFormsBindingModes.
  2. In the XamFormsBindingModes PCL library, right-click and choose Add | Class…; give it the name Person.cs and click Add.
  3. We will create an extension method extending the PropertyChangedEventHandler ...

Get Xamarin: Cross-Platform Mobile Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.