Customizing the attributes page for viewing and editing
The application framework provides ViewAttributesPage and EditAttributesPage specifically for attribute viewing and editing, respectively. Both are designed to take a feature and create different groups for displaying attributes. The first group presents information about its geometry, for example, coordinate for a point, length for a polyline, or area for a polygon.
Both pages use the concept of a group to organize information for each column from a feature. If there is more information than can be displayed on one page, a scroll bar is provided on the side. You can also use the arrow keys or the rocker to browse from one group to the other.
The following screen capture shows default groups created by ViewAttributesPage and EditAttributesPage based on a feature they take:
Additionally, the Edit Attributes page provides native support for attribute and geometry editing. You can activate a group by tapping the small arrow on the right. Depending on column type and domain or subtype settings, it will automatically navigate to a new data entry page and take you back to the Edit Attributes page after accepting or abandoning edits, the location (geometry) group navigates you to start the geometry editing workflow.
Customizing ViewAttributesPage and EditAttributesPage
Technically, you can create your own page for attribute viewing and editing; however, this isn't necessary since you can customize ViewAttributesPage and EditAttributesPage to fit your needs.
To customize the View Attributes page, listen to ViewAttributesPage.CreatingViewGroups. This event is fired when the groups are being created on the page. Each group typically contains two text items, one for the header (the name of the column) and the other for the value of the column. You can add, remove, or modify the group. For example, you can put a button in a group that represents a BLOB column that stores audio and starts playing the audio when tapped.
Similar to ViewAttributesPage, EditAttributesPage fires a CreatingEditGroups event when groups are being constructed on the page. You can customize groups to meet your needs by handling this event. For the example mentioned above, you can navigate to a new page, allowing recording of new audio when the BLOB group is activated.
The following screen capture shows navigation to a page where you can record audio and save it in a BLOB field. For more details, see the AttributesExtension sample.
As mentioned earlier, the first group on the View Attributes page and Edit Attributes page is always the geometry group. You can remove it from the page, and add your own geometry group. You can also present the geometry information in a different format, or start your own geometry collection workflow.