DataTemplate vs ItemContainerTemplate

前端 未结 4 1009
花落未央
花落未央 2021-01-11 23:13

What is ItemContainerTemplate used for? It is derived from DataTemplate, but I don\'t see any difference between them except the ItemContainerTemplateKey property. When shou

4条回答
  •  终归单人心
    2021-01-11 23:51

    The ItemContainerTemplate describes the world around your Item. For example in a ListBox the selection rectangle around your ListBoxItem. The DataTemplate describes how you ListBoxItem apears and of which elements it consists.

    Dr. WPF did a good example: http://drwpf.com/blog/category/item-containers/

提交回复
热议问题