【发布时间】:2012-02-09 23:40:43
【问题描述】:
我有以下列表框项目的数据模板:
<DataTemplate x:Key="substanceListShower">
<ListBox ItemsSource="{Binding Items}">
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox>
</DataTemplate>
然后我像这样应用项目模板:
ReactantInterfacesListBox.ItemTemplate = (DataTemplate)FindResource("substanceListShower");
但在项目列表中,我得到一个 ToString() 返回:
System.Windows.Controls.ItemsPanelTemplate
任何帮助将不胜感激。
【问题讨论】:
标签: wpf listbox datatemplate stackpanel itemtemplate