2011-11-25 50 views
0

你好,我目前正在一个项目上工作,并正在使用Listbox.ItemTemplate。 我试图让模板是这样的:ItemTemplate with image

 <ListBox.ItemTemplate> 
      <DataTemplate> 
       <Border BorderThickness="2" BorderBrush="Black" Margin="10" Width="100" Height="100" > 
       //Image here// 
       </Border> 
      </DataTemplate> 
     </ListBox.ItemTemplate> 

的事情是,我手动添加一个C#方法的帮助的项目。 有没有人知道我如何在上面显示的项目添加一个寺庙?

回答

0

如果您将模板添加到ListBox(如上所述),那么添加到列表框的任何项目都会将该模板应用到它们。该模板适用于列表框中的全部项目。