Pages

Men

rh

7/21/2012

What is the difference between ItemsControl, ItemsPresenter, ContentControl, ContentPresenter, DataTemplate, HierarchicalDataTemplate in WPF

What is the difference between ItemsControl, ItemsPresenter, ContentControl, ContentPresenter, DataTemplate, HierarchicalDataTemplate

ControlTemplate – Defines the entire layout of a control (rather than just what is substituted in the ContentPresenter).  It is defined to exist within a Template property for a Control.

ContentControl – A control that allows developers to define UIElements that can be displayed within the control

ContentPresenter – A stub in the ControlTemplate for where the content from the Content property of a ContentControl should be inserted

ItemsControl – Control that displays a collection of items

ItemsPresenter – An ItemsControl.Template can contain a ControlTemplate.  The 

ItemsPresenter is the stub for where the items should be rendered in the ControlTemplate

DataTemplate – Defines how to visualize a business object (as opposed to a ControlTemplate that defines how to visualize a control)

HierarchicalDataTemplate – Defines how to visualize different levels of hierarchical data

No comments :

Post a Comment