Displaying collections of data with DataTemplates
Another powerful type of resource is DataTemplates
, which you can use to customize the look and feel of a control. As the name says, these templates are supported by controls that you can use to display collections of data, such as ListView
or GridView
. Thanks to DataTemplate
, you can define the look and feel of a single item of the collection, which will then be applied to all the items.
This is an example of what DataTemplate
looks like:
<ListView> <ListView.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Name}" /> <TextBlock Text...