模板
控件模板ControlTemplate:用于改变控件外观,在原有数据内容(ContentPresenter,ItemsPresenter)外部添加装饰器(如边框)
数据模板DataTemplate:用于组织显示数据内容(解析显示-数据类)
ListBoxItem
1. ListBoxItem控件模板Template:包装项(蓝色边框) ItemsPresenter
2. ListBoxItem数据模板ContentTemplate: (灰色背景显示)
ListBox
- ListBox 控件模板Template:仅控制整体的外观(红色边框) ContentPresenter
- ListBox的数据模板ItemTemplate:(黄色内容)会覆盖 ListBoxItem的模板