你好,我目前正在做一个项目,正在使用Listbox.ItemTemplate。我试着让模板看起来像这样:
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderThickness="2" BorderBrush="Black" Margin="10" Width="100" Height="100" >
//Image here//
</Border>
</DataTemplate>
</ListBox.ItemTemplate>问题是,我在c#方法的帮助下手动添加了这些项。有没有人知道我如何将神庙添加到上面所示的项目中?
发布于 2011-11-25 12:06:14
如果您将模板添加到ListBox (如上所述),则添加到列表框的任何项都将应用该模板。该模板适用于列表框中的所有项。
https://stackoverflow.com/questions/8264455
复制相似问题