【问题标题】:ItemTemplate with image带有图像的项目模板
【发布时间】:2011-11-25 03:06:30
【问题描述】:

您好,我目前正在处理一个项目,并且正在使用 Listbox.ItemTemplate。 我正在尝试使模板看起来像这样:

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

问题是我在 c# 方法的帮助下手动添加项目。 有谁知道我如何在上面显示的项目中添加神殿?

【问题讨论】:

    标签: c# wpf xaml listbox


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2018-11-10
      • 2018-06-28
      • 2019-06-13
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多