Populating user interface widgets

At this point, we have a reference to the PointOfInterest object, but we have not taken any action to populate the content on UI. Populating the POI details on UI is a pretty straightforward process.

The EditText widget has a property named Text, which we can set to initialize the content for the widget. Let's create a simple method named UpdateUI(), which takes care of populating the POI details on the user interface widgets.

The following listing shows what is needed for UpdateUI():

protected void UpdateUI() { _nameEditText.Text = _poi.Name; _descrEditText.Text = _poi.Description; _addrEditText.Text = _poi.Address; _latEditText.Text = _poi.Latitude.ToString (); _longEditText.Text = _poi.Longitude.ToString (); ...

Get Xamarin Mobile Application Development for Android - Second Edition 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.