Creating an Object for a List from a Collection Element
The following steps describe how a mobile List control constructs a MobileListItem instance from an element in the collection:
The control checks whether the DataTextField or DataValueField properties are defined. If they are, the control uses these field names to discover properties from the element and set the Text and Value properties of the MobileListItem instance.
If neither the DataTextField nor DataValueField properties are defined, the control sets the Text and Value properties of the MobileListItem instance to the string representation of the element (by using the ToString method).
If an ItemDataBind event handler is defined, the handler is called. You can use this handler to set properties of the MobileListItem instance.
When providing default rendering, the list control represents a MobileListItem instance by its Text property. In templated rendering, the template can render a desired property of the MobileListItem instance or associated data-bound object.
When the ItemsAsLinks property is set, the List control renders items as hyperlinks. The value of the Text property becomes the link text, and the value of the Value property becomes the target URL.
If your list is complex, such as an array of objects, you cannot directly access the members of the selected item through the selection. However, if you design your application appropriately, you can access the associated object. If you are creating a group of objects to populate your list, you can make the group a global array, and then handle the returned value as an index into the array, as shown in the following code sample.