Skip to content

Data Template

A DataTemplate consists of a tree of WPF visual elements (so called visual tree). Data Templates are used to render data objects on the screen.

Example:

When you add Student objects into an ItemsControl, WPF doesn’t know how to display your Student objects. Therefore, the ItemsControl has a property ItemTemplate of type DataTemplate. You could define that the properties of a student are arranged in a Grid with labels.

Copyright (c) by Thomas Kemp, 2021