Glossary Item Box
The DataPresenter architecture supports the consumption and display of hierarchical data, heterogeneous data, and free-form data structures (trees). Heterogeneous data describes a data source that contains records of different types. This is supported based on xamDataPresenter's™ ability to assign a different FieldLayout to each DataRecord.
Hierarchical data is automatically supported unless the IsNestedDataDisplayEnabled property is set to False. By default, any field that has a DataType that implements the System.Collections.IEnumerable interface, other than string is marked as "expandable". You can explicitly change this by setting the Field's IsExpandable property.
When a Field is marked as expandable, CellValuePresenters are not created to represent the field in the UI. Instead, an ExpandableFieldRecord is created and added to each DataRecord's ChildRecords collection. An ExpandableFieldRecord, like a DataRecord, is not a UIElement™ but rather a lightweight object. It is represented in the UI by a corresponding ExpandableFieldRecordPresenter (for more information, see Performance Optimizations Overview).
If the associated Field's DataType implements the IEnumerable interface, a ChildRecordManager is initialized to create and manage the child DataRecords. In this case, when the ExpandableFieldRecord is expanded, the ExpandableFieldRecordPresenter's NestedContent will contain a RecordListControl containing the child DataRecordPresenters. Otherwise, the NestedContent will contain an ExpandedCellPresenter with the actual cell value.
Different Views support hierarchical data differently. Therefore, the RecordPresenter-derived classes (DataRecordPresenter, GroupByRecordPresenter, and ExpandableFieldRecordPresenter) expose a TemplateGridView and a TemplateCardView property to vary their visual trees based on the view. For example, in the Grid view, a RecordPresenter will normally show an expansion indicator in the UI that is used to toggle its IsExpanded state, and will show its nested child records directly beneath its record content. However, in a Card view, this is not the case. Normally, Card views, like the Carousel view, are limited to showing only sibling records at any one time. Therefore, the Carousel view supports hierarchical data through a drill-down metaphor that makes use of breadcrumbs to visualize and navigate the drill-down path.